@@ -232,7 +232,7 @@ def test_edit_telechat_date(self):
232232 data = dict (intended_std_level = str (draft .intended_std_level_id ),
233233 stream = draft .stream_id ,
234234 ad = str (draft .ad_id ),
235- notify = "test@example.com" ,
235+ notify = draft . notify ,
236236 note = "" ,
237237 )
238238
@@ -241,6 +241,7 @@ def test_edit_telechat_date(self):
241241 self .assertEqual (r .status_code , 200 )
242242
243243 # add to telechat
244+ mailbox_before = len (outbox )
244245 self .assertTrue (not draft .latest_event (TelechatDocEvent , type = "scheduled_for_telechat" ))
245246 data ["telechat_date" ] = TelechatDate .objects .active ()[0 ].date .isoformat ()
246247 r = self .client .post (url , data )
@@ -249,8 +250,11 @@ def test_edit_telechat_date(self):
249250 draft = Document .objects .get (name = draft .name )
250251 self .assertTrue (draft .latest_event (TelechatDocEvent , type = "scheduled_for_telechat" ))
251252 self .assertEqual (draft .latest_event (TelechatDocEvent , type = "scheduled_for_telechat" ).telechat_date , TelechatDate .objects .active ()[0 ].date )
253+ self .assertEqual (len (outbox ),mailbox_before + 1 )
254+ self .assertTrue ("Telechat update" in outbox [- 1 ]['Subject' ])
252255
253256 # change telechat
257+ mailbox_before = len (outbox )
254258 data ["telechat_date" ] = TelechatDate .objects .active ()[1 ].date .isoformat ()
255259 r = self .client .post (url , data )
256260 self .assertEqual (r .status_code , 302 )
@@ -259,6 +263,8 @@ def test_edit_telechat_date(self):
259263 telechat_event = draft .latest_event (TelechatDocEvent , type = "scheduled_for_telechat" )
260264 self .assertEqual (telechat_event .telechat_date , TelechatDate .objects .active ()[1 ].date )
261265 self .assertFalse (telechat_event .returning_item )
266+ self .assertEqual (len (outbox ),mailbox_before + 1 )
267+ self .assertTrue ("Telechat update" in outbox [- 1 ]['Subject' ])
262268
263269 # change to a telechat that should cause returning item to be auto-detected
264270 # First, make it appear that the previous telechat has already passed
@@ -277,12 +283,15 @@ def test_edit_telechat_date(self):
277283 self .assertTrue (telechat_event .returning_item )
278284
279285 # remove from agenda
286+ mailbox_before = len (outbox )
280287 data ["telechat_date" ] = ""
281288 r = self .client .post (url , data )
282289 self .assertEqual (r .status_code , 302 )
283290
284291 draft = Document .objects .get (name = draft .name )
285292 self .assertTrue (not draft .latest_event (TelechatDocEvent , type = "scheduled_for_telechat" ).telechat_date )
293+ self .assertEqual (len (outbox ),mailbox_before + 1 )
294+ self .assertTrue ("Telechat update" in outbox [- 1 ]['Subject' ])
286295
287296 def test_start_iesg_process_on_draft (self ):
288297 make_test_data ()
0 commit comments