|
10 | 10 |
|
11 | 11 | from django.conf import settings |
12 | 12 | from django.urls import reverse as urlreverse |
| 13 | +from django.template.loader import render_to_string |
13 | 14 |
|
14 | 15 | from ietf.group.factories import RoleFactory |
15 | 16 | from ietf.doc.factories import BofreqFactory, NewRevisionDocEventFactory |
@@ -326,6 +327,10 @@ def test_start_new_bofreq(self): |
326 | 327 | login_testing_unauthorized(self,nobody.user.username,url) |
327 | 328 | r = self.client.get(url) |
328 | 329 | self.assertContains(r,'Fill in the details below. Keep items in the order they appear here.',status_code=200) |
| 330 | + r = self.client.post(url, dict(title='default', |
| 331 | + bofreq_submission='enter', |
| 332 | + bofreq_content=render_to_string('doc/bofreq/bofreq_template.md',{}))) |
| 333 | + self.assertContains(r, 'The example content may not be saved.', status_code=200) |
329 | 334 | file = NamedTemporaryFile(delete=False,mode="w+",encoding='utf-8') |
330 | 335 | file.write('some stuff') |
331 | 336 | file.close() |
@@ -360,3 +365,21 @@ def test_start_new_bofreq(self): |
360 | 365 | self.assertEqual(r.status_code, 200) |
361 | 366 | q = PyQuery(r.content) |
362 | 367 | self.assertTrue(q('form div.has-error')) |
| 368 | + |
| 369 | + def test_change_notify(self): |
| 370 | + doc = BofreqFactory() |
| 371 | + url = urlreverse('ietf.doc.views_doc.edit_notify;bofreq', kwargs=dict(name=doc.name)) |
| 372 | + login_testing_unauthorized(self, "secretary", url) |
| 373 | + |
| 374 | + # get |
| 375 | + r = self.client.get(url) |
| 376 | + self.assertEqual(r.status_code,200) |
| 377 | + q = PyQuery(r.content) |
| 378 | + self.assertEqual(len(q('form input[name=notify]')),1) |
| 379 | + |
| 380 | + # Provide a list |
| 381 | + r = self.client.post(url,dict(notify="TJ2APh2P@ietf.org",save_addresses="1")) |
| 382 | + self.assertEqual(r.status_code,302) |
| 383 | + doc = reload_db_objects(doc) |
| 384 | + self.assertEqual(doc.notify,'TJ2APh2P@ietf.org') |
| 385 | + |
0 commit comments