|
16 | 16 | from ietf.doc.factories import DocumentFactory, IndividualDraftFactory, IndividualRfcFactory, WgDraftFactory |
17 | 17 | from ietf.doc.utils import create_ballot_if_not_open |
18 | 18 | from ietf.group.models import Group, Role |
19 | | -from ietf.group.factories import GroupFactory, RoleFactory |
| 19 | +from ietf.group.factories import GroupFactory, RoleFactory, ReviewTeamFactory |
20 | 20 | from ietf.ipr.factories import HolderIprDisclosureFactory |
21 | 21 | from ietf.name.models import BallotPositionName |
22 | 22 | from ietf.iesg.models import TelechatDate |
@@ -804,6 +804,42 @@ def test_make_last_call(self): |
804 | 804 |
|
805 | 805 | self.assertTrue("Last Call" in draft.message_set.order_by("-time")[0].subject) |
806 | 806 |
|
| 807 | + def test_make_last_call_yang_document(self): |
| 808 | + yd = ReviewTeamFactory(acronym='yangdoctors') |
| 809 | + secr_email = RoleFactory(group=yd,name_id='secr').person.email().address |
| 810 | + draft = WgDraftFactory() |
| 811 | + submission = draft.submission_set.create( |
| 812 | + state_id = 'posted', |
| 813 | + name = draft.name, |
| 814 | + group = draft.group, |
| 815 | + rev = draft.rev, |
| 816 | + authors = '[]', |
| 817 | + ) |
| 818 | + submission.checks.create( |
| 819 | + checker = 'yang validation', |
| 820 | + passed = True, |
| 821 | + ) |
| 822 | + |
| 823 | + |
| 824 | + url = urlreverse('ietf.doc.views_ballot.make_last_call', kwargs=dict(name=draft.name)) |
| 825 | + login_testing_unauthorized(self, 'secretary', url) |
| 826 | + |
| 827 | + mailbox_before = len(outbox) |
| 828 | + |
| 829 | + last_call_sent_date = datetime.date.today() |
| 830 | + expire_date = last_call_sent_date+datetime.timedelta(days=14) |
| 831 | + |
| 832 | + r = self.client.post(url, |
| 833 | + dict(last_call_sent_date=last_call_sent_date, |
| 834 | + last_call_expiration_date=expire_date |
| 835 | + )) |
| 836 | + self.assertEqual(r.status_code, 302) |
| 837 | + self.assertEqual(len(outbox), mailbox_before + 3) |
| 838 | + self.assertIn("ietf-announce@", outbox[-3]['To']) |
| 839 | + self.assertIn("drafts-lastcall@icann.org", outbox[-2]['To']) |
| 840 | + self.assertIn(secr_email, outbox[-1]['To']) |
| 841 | + |
| 842 | + |
807 | 843 | class DeferUndeferTestCase(TestCase): |
808 | 844 | def helper_test_defer(self,name): |
809 | 845 |
|
|
0 commit comments