@@ -659,7 +659,7 @@ def test_warn_expirable_drafts(self):
659659
660660 self .assertEqual (len (list (get_soon_to_expire_drafts (14 ))), 0 )
661661
662- # hack into expirable state
662+ # hack into expirable state to expire in 10 days
663663 draft .set_state (State .objects .get (type_id = 'draft-iesg' ,slug = 'idexists' ))
664664 draft .expires = timezone .now () + datetime .timedelta (days = 10 )
665665 draft .save_with_history ([DocEvent .objects .create (doc = draft , rev = draft .rev , type = "changed_document" , by = Person .objects .get (user__username = "secretary" ), desc = "Test" )])
@@ -675,8 +675,17 @@ def test_warn_expirable_drafts(self):
675675 self .assertTrue ('draft-ietf-mars-test@' in outbox [- 1 ]['To' ]) # Gets the authors
676676 self .assertTrue ('mars-chairs@ietf.org' in outbox [- 1 ]['Cc' ])
677677 self .assertTrue ('aread@' in outbox [- 1 ]['Cc' ])
678+
679+ # hack into expirable state to expire in 10 hours
680+ draft .expires = timezone .now () + datetime .timedelta (hours = 10 )
681+ draft .save_with_history ([DocEvent .objects .create (doc = draft , rev = draft .rev , type = "changed_document" , by = Person .objects .get (user__username = "secretary" ), desc = "Test" )])
682+
683+ # test send warning is not sent for a document so close to expiration
684+ mailbox_before = len (outbox )
685+ send_expire_warning_for_draft (draft )
686+ self .assertEqual (len (outbox ), mailbox_before )
678687
679- #Check that we don't sent expiration warnings for dead or replaced drafts
688+ # Check that we don't sent expiration warnings for dead or replaced drafts
680689 old_state = draft .get_state_slug ("draft-iesg" )
681690 mailbox_before = len (outbox )
682691 draft .set_state (State .objects .get (type_id = "draft-iesg" ,slug = "dead" ))
0 commit comments