Merged in [14850] from rjsparks@nostrum.com:

Improvements to test coverage in ietf.meeting.views
 - Legacy-Id: 14866
Note: SVN reference [14850] has been migrated to Git commit 02d975ab19
This commit is contained in:
Henrik Levkowetz 2018-03-19 19:04:04 +00:00
commit 1744736ed0
2 changed files with 41 additions and 0 deletions

11
PLAN
View file

@ -12,6 +12,17 @@ Planned work in rough order
* Introduce an API for Meetecho to use to associate recordings with sessions
(and perhaps automate making copies of those videos)
* GDPR related: a) Add SimpleHistory for Person in order to have traceability
of changes to person records. Include client IP address. b) Make sure all
parts of a person's record is reflected on the account page and can be
updated/corrected. c) Any form update requires a checkbox filled in which
signifies consent to use the data on the IETF website. d) The submission
tool also requires a consent checkbox for usage of personal data contained
in the uploaded draft. e) There should be a link (in the footer?) to a page
common for the IETF, probably, that describes how to request purging your
personal information from the datatracker. Actual purging can be done trough
the Django admin interface, no new software required.
* Reworked UI and refactored backend for the scretariat meeting scheduling
tool.

View file

@ -37,6 +37,7 @@ from ietf.group.factories import GroupFactory, GroupEventFactory
from ietf.meeting.factories import ( SessionFactory, SessionPresentationFactory, ScheduleFactory,
MeetingFactory, FloorPlanFactory, TimeSlotFactory )
from ietf.doc.factories import DocumentFactory
from ietf.submit.tests import submission_file
class MeetingTests(TestCase):
@ -462,6 +463,35 @@ class MeetingTests(TestCase):
self.assertNotContains(r, t2.time.strftime('%Y%m%dT%H%M%S'))
self.assertContains(r, 'END:VEVENT')
def test_session_draft_tarfile(self):
session = SessionFactory(group__type_id='wg',meeting__type_id='ietf')
doc = DocumentFactory(type_id='draft')
session.sessionpresentation_set.create(document=doc)
file,_ = submission_file(name=doc.name,format='txt',templatename='test_submission.txt',group=session.group,rev="00")
filename = os.path.join(doc.get_file_path(),file.name)
with open(filename,'w') as draftbits:
draftbits.write(file.getvalue())
url = urlreverse('ietf.meeting.views.session_draft_tarfile', kwargs={'num':session.meeting.number,'acronym':session.group.acronym})
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.get('Content-Type'), 'application/octet-stream')
os.unlink(filename)
def test_session_draft_pdf(self):
session = SessionFactory(group__type_id='wg',meeting__type_id='ietf')
doc = DocumentFactory(type_id='draft')
session.sessionpresentation_set.create(document=doc)
file,_ = submission_file(name=doc.name,format='txt',templatename='test_submission.txt',group=session.group,rev="00")
filename = os.path.join(doc.get_file_path(),file.name)
with open(filename,'w') as draftbits:
draftbits.write(file.getvalue())
url = urlreverse('ietf.meeting.views.session_draft_pdf', kwargs={'num':session.meeting.number,'acronym':session.group.acronym})
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.get('Content-Type'), 'application/pdf')
os.unlink(filename)
class EditTests(TestCase):