Skip to content

Commit 363b451

Browse files
committed
Merged in [10586] from housley@vigilsec.com:
Added automated tests for the fix for ticket ietf-tools#1751. - Legacy-Id: 10613 Note: SVN reference [10586] has been migrated to Git commit 014e79f
2 parents 8b0e6d1 + 014e79f commit 363b451

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

ietf/secr/drafts/tests_views.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
from django.conf import settings
66
from django.core.urlresolvers import reverse as urlreverse
77

8-
from ietf.utils.test_utils import TestCase
8+
from ietf.doc.models import State
99
from ietf.person.models import Person
1010
from ietf.submit.models import Preapproval
11+
from ietf.utils.test_utils import TestCase
1112
from ietf.utils.test_data import make_test_data
13+
from ietf.secr.drafts.email import get_email_initial
1214

13-
#from pyquery import PyQuery
15+
from pyquery import PyQuery
1416

1517
SECR_USER='secretary'
1618

@@ -83,6 +85,32 @@ def test_email(self):
8385
# can't test this directly, test via drafts actions
8486
pass
8587

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+
86114
def test_makerfc(self):
87115
draft = make_test_data()
88116
url = urlreverse('drafts_edit', kwargs={'id':draft.name})

0 commit comments

Comments
 (0)