|
5 | 5 | from django.conf import settings |
6 | 6 | from django.core.urlresolvers import reverse as urlreverse |
7 | 7 |
|
8 | | -from ietf.utils.test_utils import TestCase |
| 8 | +from ietf.doc.models import State |
9 | 9 | from ietf.person.models import Person |
10 | 10 | from ietf.submit.models import Preapproval |
| 11 | +from ietf.utils.test_utils import TestCase |
11 | 12 | from ietf.utils.test_data import make_test_data |
| 13 | +from ietf.secr.drafts.email import get_email_initial |
12 | 14 |
|
13 | | -#from pyquery import PyQuery |
| 15 | +from pyquery import PyQuery |
14 | 16 |
|
15 | 17 | SECR_USER='secretary' |
16 | 18 |
|
@@ -83,6 +85,32 @@ def test_email(self): |
83 | 85 | # can't test this directly, test via drafts actions |
84 | 86 | pass |
85 | 87 |
|
| 88 | + def test_get_email_initial(self): |
| 89 | + # Makes sure that a manual posting by the Secretariat of an I-D that is |
| 90 | + # in the RFC Editor Queue will result in notification of the RFC Editor |
| 91 | + draft = make_test_data() |
| 92 | + state = State.objects.get(type='draft-iesg',slug='rfcqueue') |
| 93 | + draft.set_state(state) |
| 94 | + data = get_email_initial(draft,type='revision') |
| 95 | + self.assertTrue('rfc-editor@rfc-editor.org' in data['to']) |
| 96 | + |
| 97 | + def test_revision_rfcqueue(self): |
| 98 | + # Makes sure that a manual posting by the Secretariat of an I-D that is |
| 99 | + # in the RFC Editor Queue will result in notification of the RFC Editor |
| 100 | + draft = make_test_data() |
| 101 | + state = State.objects.get(type='draft-iesg',slug='rfcqueue') |
| 102 | + draft.set_state(state) |
| 103 | + url = urlreverse('drafts_revision', kwargs={'id':draft.name}) |
| 104 | + self.client.login(username="secretary", password="secretary+password") |
| 105 | + rev = str(int(draft.rev) + 1).zfill(2) |
| 106 | + file = StringIO("This is a test.") |
| 107 | + file.name = "%s-%s.txt" % (draft.name, rev) |
| 108 | + post = {'title':'The Title','pages':'10','txt':file} |
| 109 | + response = self.client.post(url,post,follow=True) |
| 110 | + self.assertEqual(response.status_code, 200) |
| 111 | + q = PyQuery(response.content) |
| 112 | + self.assertTrue('rfc-editor@rfc-editor.org' in q("#draft-confirm-email tr:first-child td").html()) |
| 113 | + |
86 | 114 | def test_makerfc(self): |
87 | 115 | draft = make_test_data() |
88 | 116 | url = urlreverse('drafts_edit', kwargs={'id':draft.name}) |
|
0 commit comments