44import django .test
55
66from ietf .utils .test_utils import SimpleUrlTestCase , canonicalize_sitemap
7- from ietf .utils .test_runner import mail_outbox
87from ietf .utils .test_data import make_test_data
8+ from ietf .utils .mail import outbox
99
1010from ietf .announcements .models import ScheduledAnnouncement
1111
@@ -31,13 +31,13 @@ def test_send_plain_announcement(self):
3131 content_type = "" ,
3232 )
3333
34- mailbox_before = len (mail_outbox )
34+ mailbox_before = len (outbox )
3535
3636 from ietf .announcements .send_scheduled import send_scheduled_announcement
3737 send_scheduled_announcement (a )
3838
39- self .assertEquals (len (mail_outbox ), mailbox_before + 1 )
40- self .assertTrue ("This is a test" in mail_outbox [- 1 ]["Subject" ])
39+ self .assertEquals (len (outbox ), mailbox_before + 1 )
40+ self .assertTrue ("This is a test" in outbox [- 1 ]["Subject" ])
4141 self .assertTrue (ScheduledAnnouncement .objects .get (id = a .id ).mail_sent )
4242
4343 def test_send_mime_announcement (self ):
@@ -52,14 +52,14 @@ def test_send_mime_announcement(self):
5252 content_type = 'Multipart/Mixed; Boundary="NextPart"' ,
5353 )
5454
55- mailbox_before = len (mail_outbox )
55+ mailbox_before = len (outbox )
5656
5757 from ietf .announcements .send_scheduled import send_scheduled_announcement
5858 send_scheduled_announcement (a )
5959
60- self .assertEquals (len (mail_outbox ), mailbox_before + 1 )
61- self .assertTrue ("This is a test" in mail_outbox [- 1 ]["Subject" ])
62- self .assertTrue ("--NextPart" in mail_outbox [- 1 ].as_string ())
60+ self .assertEquals (len (outbox ), mailbox_before + 1 )
61+ self .assertTrue ("This is a test" in outbox [- 1 ]["Subject" ])
62+ self .assertTrue ("--NextPart" in outbox [- 1 ].as_string ())
6363 self .assertTrue (ScheduledAnnouncement .objects .get (id = a .id ).mail_sent )
6464
6565
@@ -87,13 +87,13 @@ def test_send_plain_announcement(self):
8787 send_at = datetime .datetime .now () + datetime .timedelta (hours = 12 )
8888 )
8989
90- mailbox_before = len (mail_outbox )
90+ mailbox_before = len (outbox )
9191
9292 from ietf .announcements .send_scheduled import send_scheduled_announcement
9393 send_scheduled_announcement (q )
9494
95- self .assertEquals (len (mail_outbox ), mailbox_before + 1 )
96- self .assertTrue ("This is a test" in mail_outbox [- 1 ]["Subject" ])
95+ self .assertEquals (len (outbox ), mailbox_before + 1 )
96+ self .assertTrue ("This is a test" in outbox [- 1 ]["Subject" ])
9797 self .assertTrue (SendQueue .objects .get (id = q .id ).sent_at )
9898
9999 def test_send_mime_announcement (self ):
@@ -119,14 +119,14 @@ def test_send_mime_announcement(self):
119119 send_at = datetime .datetime .now () + datetime .timedelta (hours = 12 )
120120 )
121121
122- mailbox_before = len (mail_outbox )
122+ mailbox_before = len (outbox )
123123
124124 from ietf .announcements .send_scheduled import send_scheduled_announcement
125125 send_scheduled_announcement (q )
126126
127- self .assertEquals (len (mail_outbox ), mailbox_before + 1 )
128- self .assertTrue ("This is a test" in mail_outbox [- 1 ]["Subject" ])
129- self .assertTrue ("--NextPart" in mail_outbox [- 1 ].as_string ())
127+ self .assertEquals (len (outbox ), mailbox_before + 1 )
128+ self .assertTrue ("This is a test" in outbox [- 1 ]["Subject" ])
129+ self .assertTrue ("--NextPart" in outbox [- 1 ].as_string ())
130130 self .assertTrue (SendQueue .objects .get (id = q .id ).sent_at )
131131
132132if settings .USE_DB_REDESIGN_PROXY_CLASSES :
0 commit comments