Skip to content

Commit 5b77d01

Browse files
committed
Merged in [15331] from housley@vigilsec.com:
Add test for downref in Last Call announcement - Legacy-Id: 15366 Note: SVN reference [15331] has been migrated to Git commit e2808b1
2 parents 5385aa3 + e2808b1 commit 5b77d01

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

ietf/doc/tests_downref.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from __future__ import unicode_literals
55

66
from django.urls import reverse as urlreverse
7+
from pyquery import PyQuery
78

89
import debug # pyflakes:ignore
910

@@ -112,3 +113,26 @@ def test_downref_registry_add(self):
112113
self.assertTrue(RelatedDocument.objects.filter(source=draft, target=rfc, relationship_id='downref-approval'))
113114
self.assertEqual(draft.docevent_set.count(), draft_de_count_before + 1)
114115
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+
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.assertIn('The document contains these normative downward references', 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.assertNotIn('The document contains these normative downward references', text)

0 commit comments

Comments
 (0)