@@ -152,7 +152,7 @@ def test_send_ballot_comment(self):
152152 # send
153153 mailbox_before = len (outbox )
154154
155- r = self .client .post (url , dict (cc = "test @example.com" , cc_state_change = "1" ,cc_group_list = "1" ))
155+ r = self .client .post (url , dict (cc = "test298347 @example.com" , cc_state_change = "1" ,cc_group_list = "1" ))
156156 self .assertEqual (r .status_code , 302 )
157157
158158 self .assertEqual (len (outbox ), mailbox_before + 1 )
@@ -162,16 +162,18 @@ def test_send_ballot_comment(self):
162162 self .assertTrue (draft .name in m ['Subject' ])
163163 self .assertTrue ("clearer title" in str (m ))
164164 self .assertTrue ("Test!" in str (m ))
165+ self .assertTrue ("iesg@" in m ['To' ])
165166 self .assertTrue ("somebody@example.com" in m ['Cc' ])
166- self .assertTrue ("test @example.com" in m ['Cc' ])
167+ self .assertTrue ("test298347 @example.com" in m ['Cc' ])
167168 self .assertTrue (draft .group .list_email )
168169 self .assertTrue (draft .group .list_email in m ['Cc' ])
169170
170171 r = self .client .post (url , dict (cc = "" ))
171172 self .assertEqual (r .status_code , 302 )
172173 self .assertEqual (len (outbox ), mailbox_before + 2 )
173- #TODO this would be a good place to test actual mailtoken expansions
174- #if we can find a way to get the real, or at least representative, data in place.
174+ m = outbox [- 1 ]
175+ self .assertTrue ("iesg@" in m ['To' ])
176+ self .assertFalse (draft .group .list_email in m ['Cc' ])
175177
176178
177179class BallotWriteupsTests (TestCase ):
@@ -235,6 +237,8 @@ def test_request_last_call(self):
235237 self .assertEqual (len (outbox ), mailbox_before + 1 )
236238 self .assertTrue ("Last Call" in outbox [- 1 ]['Subject' ])
237239 self .assertTrue (draft .name in outbox [- 1 ]['Subject' ])
240+ self .assertTrue ('iesg-secretary@' in outbox [- 1 ]['To' ])
241+ self .assertTrue ('aread@' in outbox [- 1 ]['Cc' ])
238242
239243 def test_edit_ballot_writeup (self ):
240244 draft = make_test_data ()
@@ -389,12 +393,18 @@ def test_approve_ballot(self):
389393 self .assertEqual (draft .get_state_slug ("draft-iesg" ), "ann" )
390394 self .assertEqual (len (outbox ), mailbox_before + 2 )
391395 self .assertTrue ("Protocol Action" in outbox [- 2 ]['Subject' ])
396+ self .assertTrue ("ietf-announce" in outbox [- 2 ]['To' ])
397+ self .assertTrue ("rfc-editor" in outbox [- 2 ]['Cc' ])
392398 # the IANA copy
393399 self .assertTrue ("Protocol Action" in outbox [- 1 ]['Subject' ])
394400 self .assertTrue (not outbox [- 1 ]['CC' ])
401+ self .assertTrue ('drafts-approval@icann.org' in outbox [- 1 ]['To' ])
395402 self .assertTrue ("Protocol Action" in draft .message_set .order_by ("-time" )[0 ].subject )
396403
397404 def test_disapprove_ballot (self ):
405+ # This tests a codepath that is not used in production
406+ # and that has already had some drift from usefulness (it results in a
407+ # older-style conflict review response).
398408 draft = make_test_data ()
399409 draft .set_state (State .objects .get (used = True , type = "draft-iesg" , slug = "nopubadw" ))
400410
@@ -412,7 +422,6 @@ def test_disapprove_ballot(self):
412422 self .assertEqual (len (outbox ), mailbox_before + 1 )
413423 self .assertTrue ("NOT be published" in str (outbox [- 1 ]))
414424
415-
416425class MakeLastCallTests (TestCase ):
417426 def test_make_last_call (self ):
418427 draft = make_test_data ()
@@ -441,10 +450,17 @@ def test_make_last_call(self):
441450 draft = Document .objects .get (name = draft .name )
442451 self .assertEqual (draft .get_state_slug ("draft-iesg" ), "lc" )
443452 self .assertEqual (draft .latest_event (LastCallDocEvent , "sent_last_call" ).expires .strftime ("%Y-%m-%d" ), expire_date )
453+
444454 self .assertEqual (len (outbox ), mailbox_before + 2 )
445455
446456 self .assertTrue ("Last Call" in outbox [- 2 ]['Subject' ])
457+ self .assertTrue ("ietf-announce@" in outbox [- 2 ]['To' ])
458+ for prefix in ['draft-ietf-mars-test' ,'mars-chairs' ,'aread' ]:
459+ self .assertTrue (prefix + "@" in outbox [- 2 ]['Cc' ])
460+
447461 self .assertTrue ("Last Call" in outbox [- 1 ]['Subject' ])
462+ self .assertTrue ("drafts-lastcall@icann.org" in outbox [- 1 ]['To' ])
463+
448464 self .assertTrue ("Last Call" in draft .message_set .order_by ("-time" )[0 ].subject )
449465
450466class DeferUndeferTestCase (TestCase ):
@@ -490,11 +506,16 @@ def helper_test_defer(self,name):
490506 if doc .type_id in defer_states :
491507 self .assertEqual (doc .get_state (defer_states [doc .type_id ][0 ]).slug ,defer_states [doc .type_id ][1 ])
492508 self .assertTrue (doc .active_defer_event ())
509+
493510 self .assertEqual (len (outbox ), mailbox_before + 2 )
494- #self.assertTrue("State Update" in outbox[-3]['Subject'])
495- self .assertTrue ("Telechat update" in outbox [- 2 ]['Subject' ])
511+
512+ self .assertTrue ('Telechat update' in outbox [- 2 ]['Subject' ])
513+ self .assertTrue ('iesg-secretary@' in outbox [- 2 ]['To' ])
514+ self .assertTrue ('iesg@' in outbox [- 2 ]['To' ])
515+
496516 self .assertTrue ("Deferred" in outbox [- 1 ]['Subject' ])
497517 self .assertTrue (doc .file_tag () in outbox [- 1 ]['Subject' ])
518+ self .assertTrue ('iesg@' in outbox [- 1 ]['To' ])
498519
499520 # Ensure it's not possible to defer again
500521 r = self .client .get (url )
@@ -547,8 +568,11 @@ def helper_test_undefer(self,name):
547568 self .assertFalse (doc .active_defer_event ())
548569 self .assertEqual (len (outbox ), mailbox_before + 2 )
549570 self .assertTrue ("Telechat update" in outbox [- 2 ]['Subject' ])
571+ self .assertTrue ('iesg-secretary@' in outbox [- 2 ]['To' ])
572+ self .assertTrue ('iesg@' in outbox [- 2 ]['To' ])
550573 self .assertTrue ("Undeferred" in outbox [- 1 ]['Subject' ])
551574 self .assertTrue (doc .file_tag () in outbox [- 1 ]['Subject' ])
575+ self .assertTrue ('iesg@' in outbox [- 1 ]['To' ])
552576
553577 # Ensure it's not possible to undefer again
554578 r = self .client .get (url )
0 commit comments