Added a test for the IESG past documents page, and tweaked some test documents to have titles.

- Legacy-Id: 14303
This commit is contained in:
Henrik Levkowetz 2017-11-04 16:15:39 +00:00
parent f0cee14abc
commit b29e096f92
2 changed files with 39 additions and 4 deletions

View file

@ -379,6 +379,37 @@ class IESGAgendaTests(TestCase):
self.assertTrue(d.name in unicontent(r), "%s not in response" % k)
self.assertTrue(d.title in unicontent(r), "%s title not in response" % k)
def test_past_documents(self):
url = urlreverse("ietf.iesg.views.past_documents")
# We haven't put any documents on past telechats, so this should be empty
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
for k, d in self.telechat_docs.iteritems():
self.assertNotIn(d.name, unicontent(r))
self.assertNotIn(d.title, unicontent(r))
# Add the documents to a past telechat
by = Person.objects.get(name="Areað Irector")
date = datetime.date.today() - datetime.timedelta(days=14)
approved = State.objects.get(type='draft-iesg', slug='approved')
iesg_eval = State.objects.get(type='draft-iesg', slug='iesg-eva')
for d in self.telechat_docs.values():
TelechatDocEvent.objects.create(type="scheduled_for_telechat",
doc=d, rev=d.rev, by=by, telechat_date=date, returning_item=False)
s = d.get_state('draft-iesg')
d.states.clear()
if s and s.slug == 'pub-req':
d.states.add(iesg_eval)
else:
d.states.add(approved)
# Now check that they are present on the past documents page
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
for k, d in self.telechat_docs.iteritems():
if d.states.get(type='draft-iesg').slug in ['approved', 'iesg-eva', ]:
self.assertIn(d.name, unicontent(r))
else:
self.assertNotIn(d.name, unicontent(r))
def test_agenda_telechat_docs(self):
d1 = self.telechat_docs["ietf_draft"]
d2 = self.telechat_docs["ise_draft"]

View file

@ -377,22 +377,26 @@ def make_test_data():
)
# an independent submission before review
doc = Document.objects.create(name='draft-imaginary-independent-submission',type_id='draft',rev='00')
doc = Document.objects.create(name='draft-imaginary-independent-submission',type_id='draft',rev='00',
title="Some Independent Notes on Imagination")
doc.set_state(State.objects.get(used=True, type="draft", slug="active"))
DocAlias.objects.create(name=doc.name, document=doc)
# an irtf submission mid review
doc = Document.objects.create(name='draft-imaginary-irtf-submission', type_id='draft',rev='00', stream=StreamName.objects.get(slug='irtf'))
doc = Document.objects.create(name='draft-imaginary-irtf-submission', type_id='draft',rev='00',
stream=StreamName.objects.get(slug='irtf'), title="The Importance of Research Imagination")
docalias = DocAlias.objects.create(name=doc.name, document=doc)
doc.set_state(State.objects.get(type="draft", slug="active"))
crdoc = Document.objects.create(name='conflict-review-imaginary-irtf-submission', type_id='conflrev', rev='00', notify="fsm@ietf.org")
crdoc = Document.objects.create(name='conflict-review-imaginary-irtf-submission', type_id='conflrev',
rev='00', notify="fsm@ietf.org", title="Conflict Review of IRTF Imagination Document")
DocAlias.objects.create(name=crdoc.name, document=crdoc)
crdoc.set_state(State.objects.get(name='Needs Shepherd', type__slug='conflrev'))
crdoc.relateddocument_set.create(target=docalias,relationship_id='conflrev')
# A status change mid review
iesg = Group.objects.get(acronym='iesg')
doc = Document.objects.create(name='status-change-imaginary-mid-review',type_id='statchg', rev='00', notify="fsm@ietf.org",group=iesg)
doc = Document.objects.create(name='status-change-imaginary-mid-review',type_id='statchg', rev='00',
notify="fsm@ietf.org", group=iesg, title="Status Change Review without Imagination")
doc.set_state(State.objects.get(slug='needshep',type__slug='statchg'))
docalias = DocAlias.objects.create(name='status-change-imaginary-mid-review',document=doc)