|
4 | 4 | from __future__ import unicode_literals |
5 | 5 |
|
6 | 6 | from django.urls import reverse as urlreverse |
| 7 | +from pyquery import PyQuery |
7 | 8 |
|
8 | 9 | import debug # pyflakes:ignore |
9 | 10 |
|
@@ -112,3 +113,26 @@ def test_downref_registry_add(self): |
112 | 113 | self.assertTrue(RelatedDocument.objects.filter(source=draft, target=rfc, relationship_id='downref-approval')) |
113 | 114 | self.assertEqual(draft.docevent_set.count(), draft_de_count_before + 1) |
114 | 115 | self.assertEqual(rfc.document.docevent_set.count(), rfc_de_count_before + 1) |
| 116 | + |
| 117 | + def test_downref_last_call(self): |
| 118 | + draft = WgDraftFactory(name='draft-ietf-mars-ready-for-lc-document',intended_std_level_id='ps',states=[('draft-iesg','iesg-eva')]) |
| 119 | + doc9999 = WgDraftFactory(name='draft-ietf-mars-another-approved-document',states=[('draft-iesg','rfcqueue')]) |
| 120 | + rfc9999 = WgRfcFactory(alias2__name='rfc9999') |
| 121 | + RelatedDocument.objects.create(source=draft, target=rfc9999.docalias_set.get(name='rfc9999'), relationship_id='refnorm') |
| 122 | + url = urlreverse('ietf.doc.views_ballot.lastcalltext', kwargs=dict(name=draft.name)) |
| 123 | + login_testing_unauthorized(self, "secretary", url) |
| 124 | + |
| 125 | + # the announcement text should call out the downref to RFC 9999 |
| 126 | + r = self.client.post(url, dict(regenerate_last_call_text="1")) |
| 127 | + self.assertEqual(r.status_code, 200) |
| 128 | + q = PyQuery(r.content) |
| 129 | + text = q("[name=last_call_text]").text() |
| 130 | + self.assertTrue('The document contains these normative downward references' in text) |
| 131 | + |
| 132 | + # now, the announcement text about the downref to RFC 9999 should be gone |
| 133 | + RelatedDocument.objects.create(source=draft, target=rfc9999.docalias_set.get(name='rfc9999'),relationship_id='downref-approval') |
| 134 | + r = self.client.post(url, dict(regenerate_last_call_text="1")) |
| 135 | + self.assertEqual(r.status_code, 200) |
| 136 | + q = PyQuery(r.content) |
| 137 | + text = q("[name=last_call_text]").text() |
| 138 | + self.assertFalse('The document contains these normative downward references' in text) |
0 commit comments