|
37 | 37 | from ietf.meeting.factories import ( SessionFactory, SessionPresentationFactory, ScheduleFactory, |
38 | 38 | MeetingFactory, FloorPlanFactory, TimeSlotFactory ) |
39 | 39 | from ietf.doc.factories import DocumentFactory |
| 40 | +from ietf.submit.tests import submission_file |
40 | 41 |
|
41 | 42 |
|
42 | 43 | class MeetingTests(TestCase): |
@@ -462,6 +463,35 @@ def test_group_ical(self): |
462 | 463 | self.assertNotContains(r, t2.time.strftime('%Y%m%dT%H%M%S')) |
463 | 464 | self.assertContains(r, 'END:VEVENT') |
464 | 465 |
|
| 466 | + def test_session_draft_tarfile(self): |
| 467 | + session = SessionFactory(group__type_id='wg',meeting__type_id='ietf') |
| 468 | + doc = DocumentFactory(type_id='draft') |
| 469 | + session.sessionpresentation_set.create(document=doc) |
| 470 | + file,_ = submission_file(name=doc.name,format='txt',templatename='test_submission.txt',group=session.group,rev="00") |
| 471 | + filename = os.path.join(doc.get_file_path(),file.name) |
| 472 | + with open(filename,'w') as draftbits: |
| 473 | + draftbits.write(file.getvalue()) |
| 474 | + |
| 475 | + url = urlreverse('ietf.meeting.views.session_draft_tarfile', kwargs={'num':session.meeting.number,'acronym':session.group.acronym}) |
| 476 | + response = self.client.get(url) |
| 477 | + self.assertEqual(response.status_code, 200) |
| 478 | + self.assertEqual(response.get('Content-Type'), 'application/octet-stream') |
| 479 | + os.unlink(filename) |
| 480 | + |
| 481 | + def test_session_draft_pdf(self): |
| 482 | + session = SessionFactory(group__type_id='wg',meeting__type_id='ietf') |
| 483 | + doc = DocumentFactory(type_id='draft') |
| 484 | + session.sessionpresentation_set.create(document=doc) |
| 485 | + file,_ = submission_file(name=doc.name,format='txt',templatename='test_submission.txt',group=session.group,rev="00") |
| 486 | + filename = os.path.join(doc.get_file_path(),file.name) |
| 487 | + with open(filename,'w') as draftbits: |
| 488 | + draftbits.write(file.getvalue()) |
| 489 | + |
| 490 | + url = urlreverse('ietf.meeting.views.session_draft_pdf', kwargs={'num':session.meeting.number,'acronym':session.group.acronym}) |
| 491 | + response = self.client.get(url) |
| 492 | + self.assertEqual(response.status_code, 200) |
| 493 | + self.assertEqual(response.get('Content-Type'), 'application/pdf') |
| 494 | + os.unlink(filename) |
465 | 495 |
|
466 | 496 |
|
467 | 497 | class EditTests(TestCase): |
|
0 commit comments