Skip to content

Commit 746ed7a

Browse files
committed
Tests for IESG Telechat moderator package changes related to downrefs
- Legacy-Id: 16125
1 parent 268b99b commit 746ed7a

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

ietf/iesg/tests.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from ietf.doc.models import DocEvent, BallotPositionDocEvent, TelechatDocEvent
1414
from ietf.doc.models import Document, DocAlias, State, RelatedDocument
15-
from ietf.doc.factories import WgDraftFactory, IndividualDraftFactory, ConflictReviewFactory, BaseDocumentFactory, CharterFactory, WgRfcFactory
15+
from ietf.doc.factories import WgDraftFactory, IndividualDraftFactory, ConflictReviewFactory, BaseDocumentFactory, CharterFactory, WgRfcFactory, IndividualRfcFactory
1616
from ietf.doc.utils import create_ballot_if_not_open
1717
from ietf.group.factories import RoleFactory, GroupFactory
1818
from ietf.group.models import Group, GroupMilestone, Role
@@ -90,7 +90,9 @@ def test_photos(self):
9090
class IESGAgendaTests(TestCase):
9191
def setUp(self):
9292
mars = GroupFactory(acronym='mars',parent=Group.objects.get(acronym='farfut'))
93-
WgDraftFactory(name='draft-ietf-mars-test',group=mars)
93+
wgdraft = WgDraftFactory(name='draft-ietf-mars-test', group=mars, intended_std_level_id='ps')
94+
rfc = IndividualRfcFactory.create(stream_id='irtf', other_aliases=['rfc6666',], states=[('draft','rfc'),('draft-iesg','pub')], std_level_id='inf', )
95+
wgdraft.relateddocument_set.create(target=rfc.docalias_set.get(name='rfc6666'), relationship_id='refnorm')
9496
ise_draft = IndividualDraftFactory(name='draft-imaginary-independent-submission')
9597
ise_draft.stream = StreamName.objects.get(slug="ise")
9698
ise_draft.save_with_history([DocEvent(doc=ise_draft, rev=ise_draft.rev, type="changed_stream", by=Person.objects.get(user__username="secretary"), desc="Test")])
@@ -364,8 +366,14 @@ def test_agenda_moderator_package(self):
364366
self.assertTrue(d.group.name in unicontent(r), "%s not in response" % k)
365367
self.assertTrue(d.group.acronym in unicontent(r), "%s acronym not in response" % k)
366368
else:
367-
self.assertTrue(d.name in unicontent(r), "%s not in response" % k)
368-
self.assertTrue(d.title in unicontent(r), "%s title not in response" % k)
369+
if d.type_id == "draft" and d.name == "draft-ietf-mars-test":
370+
self.assertTrue(d.name in unicontent(r), "%s not in response" % k)
371+
self.assertTrue(d.title in unicontent(r), "%s title not in response" % k)
372+
self.assertTrue("Has downref: Yes" in unicontent(r), "%s downref not in response" % k)
373+
self.assertTrue("Add rfc6666" in unicontent(r), "%s downref not in response" % k)
374+
else:
375+
self.assertTrue(d.name in unicontent(r), "%s not in response" % k)
376+
self.assertTrue(d.title in unicontent(r), "%s title not in response" % k)
369377

370378
def test_agenda_package(self):
371379
url = urlreverse("ietf.iesg.views.agenda_package")

ietf/secr/telechat/tests.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from django.urls import reverse
88

9-
from ietf.doc.factories import WgDraftFactory, CharterFactory
9+
from ietf.doc.factories import WgDraftFactory, IndividualRfcFactory, CharterFactory
1010
from ietf.doc.models import BallotDocEvent, BallotType, BallotPositionDocEvent
1111
from ietf.doc.utils import update_telechat, create_ballot_if_not_open
1212
from ietf.utils.test_utils import TestCase
@@ -58,6 +58,26 @@ def test_doc_detail_draft(self):
5858
self.assertEqual(q("#telechat-positions-table").find("th:contains('Recuse')").length,1)
5959
self.assertEqual(q("#telechat-positions-table").find("th:contains('No Record')").length,1)
6060

61+
def test_doc_detail_draft_with_downref(self):
62+
ad = Person.objects.get(user__username="ad")
63+
draft = WgDraftFactory(ad=ad, intended_std_level_id='ps', states=[('draft-iesg','pub-req'),])
64+
rfc = IndividualRfcFactory.create(stream_id='irtf', other_aliases=['rfc6666',],
65+
states=[('draft','rfc'),('draft-iesg','pub')], std_level_id='inf', )
66+
draft.relateddocument_set.create(target=rfc.docalias_set.get(name='rfc6666'),
67+
relationship_id='refnorm')
68+
create_ballot_if_not_open(None, draft, ad, 'approve')
69+
d = get_next_telechat_date()
70+
date = d.strftime('%Y-%m-%d')
71+
by=Person.objects.get(name="(System)")
72+
update_telechat(None, draft, by, d)
73+
url = reverse('ietf.secr.telechat.views.doc_detail', kwargs={'date':date, 'name':draft.name})
74+
self.client.login(username="secretary", password="secretary+password")
75+
response = self.client.get(url)
76+
self.assertEqual(response.status_code, 200)
77+
self.assertTrue("Has downref: Yes" in response.content)
78+
self.assertTrue("Add rfc6666" in response.content)
79+
self.assertTrue("to downref registry" in response.content)
80+
6181
def test_doc_detail_draft_invalid(self):
6282
'''Test using a document not on telechat agenda'''
6383
draft = WgDraftFactory(states=[('draft-iesg','pub-req'),])

0 commit comments

Comments
 (0)