diff --git a/ietf/iesg/tests.py b/ietf/iesg/tests.py index 7d61e5e0b..5f80a74ca 100644 --- a/ietf/iesg/tests.py +++ b/ietf/iesg/tests.py @@ -12,7 +12,7 @@ import debug # pyflakes:ignore from ietf.doc.models import DocEvent, BallotPositionDocEvent, TelechatDocEvent from ietf.doc.models import Document, DocAlias, State, RelatedDocument -from ietf.doc.factories import WgDraftFactory, IndividualDraftFactory, ConflictReviewFactory, BaseDocumentFactory, CharterFactory, WgRfcFactory +from ietf.doc.factories import WgDraftFactory, IndividualDraftFactory, ConflictReviewFactory, BaseDocumentFactory, CharterFactory, WgRfcFactory, IndividualRfcFactory from ietf.doc.utils import create_ballot_if_not_open from ietf.group.factories import RoleFactory, GroupFactory from ietf.group.models import Group, GroupMilestone, Role @@ -90,7 +90,9 @@ class IESGTests(TestCase): class IESGAgendaTests(TestCase): def setUp(self): mars = GroupFactory(acronym='mars',parent=Group.objects.get(acronym='farfut')) - WgDraftFactory(name='draft-ietf-mars-test',group=mars) + wgdraft = WgDraftFactory(name='draft-ietf-mars-test', group=mars, intended_std_level_id='ps') + rfc = IndividualRfcFactory.create(stream_id='irtf', other_aliases=['rfc6666',], states=[('draft','rfc'),('draft-iesg','pub')], std_level_id='inf', ) + wgdraft.relateddocument_set.create(target=rfc.docalias_set.get(name='rfc6666'), relationship_id='refnorm') ise_draft = IndividualDraftFactory(name='draft-imaginary-independent-submission') ise_draft.stream = StreamName.objects.get(slug="ise") 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 @@ class IESGAgendaTests(TestCase): self.assertTrue(d.group.name in unicontent(r), "%s not in response" % k) self.assertTrue(d.group.acronym in unicontent(r), "%s acronym not in response" % k) else: - 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) + if d.type_id == "draft" and d.name == "draft-ietf-mars-test": + 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) + self.assertTrue("Has downref: Yes" in unicontent(r), "%s downref not in response" % k) + self.assertTrue("Add rfc6666" in unicontent(r), "%s downref not in response" % k) + else: + 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_agenda_package(self): url = urlreverse("ietf.iesg.views.agenda_package") diff --git a/ietf/secr/telechat/tests.py b/ietf/secr/telechat/tests.py index 3d83b9d50..3dd066e6e 100644 --- a/ietf/secr/telechat/tests.py +++ b/ietf/secr/telechat/tests.py @@ -6,7 +6,7 @@ import debug # pyflakes:ignore from django.urls import reverse -from ietf.doc.factories import WgDraftFactory, CharterFactory +from ietf.doc.factories import WgDraftFactory, IndividualRfcFactory, CharterFactory from ietf.doc.models import BallotDocEvent, BallotType, BallotPositionDocEvent from ietf.doc.utils import update_telechat, create_ballot_if_not_open from ietf.utils.test_utils import TestCase @@ -58,6 +58,26 @@ class SecrTelechatTestCase(TestCase): self.assertEqual(q("#telechat-positions-table").find("th:contains('Recuse')").length,1) self.assertEqual(q("#telechat-positions-table").find("th:contains('No Record')").length,1) + def test_doc_detail_draft_with_downref(self): + ad = Person.objects.get(user__username="ad") + draft = WgDraftFactory(ad=ad, intended_std_level_id='ps', states=[('draft-iesg','pub-req'),]) + rfc = IndividualRfcFactory.create(stream_id='irtf', other_aliases=['rfc6666',], + states=[('draft','rfc'),('draft-iesg','pub')], std_level_id='inf', ) + draft.relateddocument_set.create(target=rfc.docalias_set.get(name='rfc6666'), + relationship_id='refnorm') + create_ballot_if_not_open(None, draft, ad, 'approve') + d = get_next_telechat_date() + date = d.strftime('%Y-%m-%d') + by=Person.objects.get(name="(System)") + update_telechat(None, draft, by, d) + url = reverse('ietf.secr.telechat.views.doc_detail', kwargs={'date':date, 'name':draft.name}) + self.client.login(username="secretary", password="secretary+password") + response = self.client.get(url) + self.assertEqual(response.status_code, 200) + self.assertTrue("Has downref: Yes" in response.content) + self.assertTrue("Add rfc6666" in response.content) + self.assertTrue("to downref registry" in response.content) + def test_doc_detail_draft_invalid(self): '''Test using a document not on telechat agenda''' draft = WgDraftFactory(states=[('draft-iesg','pub-req'),])