@@ -143,8 +143,8 @@ def test_ack_no_subject(self):
143143 eq (qmsg .get_content_type (), 'text/plain' )
144144 eq (qmsg .get_param ('charset' ), 'utf-8' )
145145 msgid = qmsg ['message-id' ]
146- self .failUnless (msgid .startswith ('<mailman.' ))
147- self .failUnless (msgid .endswith ('._xtest@dom.ain>' ))
146+ self .assertTrue (msgid .startswith ('<mailman.' ))
147+ self .assertTrue (msgid .endswith ('._xtest@dom.ain>' ))
148148 payload = qmsg .get_payload (decode = True ).decode ('utf-8' )
149149 eq (payload , """\
150150 Your message entitled
@@ -184,8 +184,8 @@ def test_ack_with_subject(self):
184184 eq (qmsg .get_content_type (), 'text/plain' )
185185 eq (qmsg .get_param ('charset' ), 'utf-8' )
186186 msgid = qmsg ['message-id' ]
187- self .failUnless (msgid .startswith ('<mailman.' ))
188- self .failUnless (msgid .endswith ('._xtest@dom.ain>' ))
187+ self .assertTrue (msgid .startswith ('<mailman.' ))
188+ self .assertTrue (msgid .endswith ('._xtest@dom.ain>' ))
189189 payload = qmsg .get_payload (decode = True ).decode ('utf-8' )
190190 eq (payload , """\
191191 Your message entitled
@@ -209,7 +209,7 @@ def test_process(self):
209209 last_post_time = mlist .last_post_time
210210 post_id = mlist .post_id
211211 AfterDelivery .process (mlist , None , None )
212- self .failUnless (mlist .last_post_time > last_post_time )
212+ self .assertTrue (mlist .last_post_time > last_post_time )
213213 self .assertEqual (mlist .post_id , post_id + 1 )
214214
215215
@@ -230,7 +230,7 @@ def test_approved_moderator(self):
230230""" )
231231 msgdata = {}
232232 Approve .process (mlist , msg , msgdata )
233- self .failUnless ('approved' in msgdata )
233+ self .assertTrue ('approved' in msgdata )
234234 self .assertEqual (msgdata ['approved' ], 1 )
235235
236236 def test_approve_moderator (self ):
@@ -242,7 +242,7 @@ def test_approve_moderator(self):
242242""" )
243243 msgdata = {}
244244 Approve .process (mlist , msg , msgdata )
245- self .failUnless ('approved' in msgdata )
245+ self .assertTrue ('approved' in msgdata )
246246 self .assertEqual (msgdata ['approved' ], 1 )
247247
248248 def test_approved_admin (self ):
@@ -254,7 +254,7 @@ def test_approved_admin(self):
254254""" )
255255 msgdata = {}
256256 Approve .process (mlist , msg , msgdata )
257- self .failUnless ('approved' in msgdata )
257+ self .assertTrue ('approved' in msgdata )
258258 self .assertEqual (msgdata ['approved' ], 1 )
259259
260260 def test_approve_admin (self ):
@@ -266,7 +266,7 @@ def test_approve_admin(self):
266266""" )
267267 msgdata = {}
268268 Approve .process (mlist , msg , msgdata )
269- self .failUnless ('approved' in msgdata )
269+ self .assertTrue ('approved' in msgdata )
270270 self .assertEqual (msgdata ['approved' ], 1 )
271271
272272 def test_unapproved (self ):
@@ -316,7 +316,7 @@ def test_simple_path(self):
316316
317317""" , Message .Message )
318318 CalcRecips .process (self ._mlist , msg , msgdata )
319- self .failUnless ('recips' in msgdata )
319+ self .assertTrue ('recips' in msgdata )
320320 recips = msgdata ['recips' ]
321321 recips .sort ()
322322 self .assertEqual (recips , ['aperson@dom.ain' , 'bperson@dom.ain' ,
@@ -331,7 +331,7 @@ def test_exclude_sender(self):
331331 self ._mlist .setMemberOption ('cperson@dom.ain' ,
332332 mm_cfg .DontReceiveOwnPosts , 1 )
333333 CalcRecips .process (self ._mlist , msg , msgdata )
334- self .failUnless ('recips' in msgdata )
334+ self .assertTrue ('recips' in msgdata )
335335 recips = msgdata ['recips' ]
336336 recips .sort ()
337337 self .assertEqual (recips , ['aperson@dom.ain' , 'bperson@dom.ain' ])
@@ -345,7 +345,7 @@ def test_urgent_moderator(self):
345345
346346""" , Message .Message )
347347 CalcRecips .process (self ._mlist , msg , msgdata )
348- self .failUnless ('recips' in msgdata )
348+ self .assertTrue ('recips' in msgdata )
349349 recips = msgdata ['recips' ]
350350 recips .sort ()
351351 self .assertEqual (recips , ['aperson@dom.ain' , 'bperson@dom.ain' ,
@@ -362,7 +362,7 @@ def test_urgent_admin(self):
362362
363363""" , Message .Message )
364364 CalcRecips .process (self ._mlist , msg , msgdata )
365- self .failUnless ('recips' in msgdata )
365+ self .assertTrue ('recips' in msgdata )
366366 recips = msgdata ['recips' ]
367367 recips .sort ()
368368 self .assertEqual (recips , ['aperson@dom.ain' , 'bperson@dom.ain' ,
@@ -589,7 +589,7 @@ def test_no_subject_munging_has_prefix(self):
589589""" , Message .Message )
590590 CookHeaders .process (self ._mlist , msg , {})
591591 # prefixing depends on mm_cfg.py
592- self .failUnless (str (msg ['subject' ]) == 'Re: [XTEST] About Mailman...' or
592+ self .assertTrue (str (msg ['subject' ]) == 'Re: [XTEST] About Mailman...' or
593593 str (msg ['subject' ]) == '[XTEST] Re: About Mailman...' )
594594
595595 def test_reply_to_list (self ):
@@ -1281,7 +1281,7 @@ def test_hold_notifications(self):
12811281 data = self ._mlist .pend_confirm (cookie )
12821282 eq (data , ('H' , 1 ))
12831283 heldmsg = os .path .join (mm_cfg .DATA_DIR , 'heldmsg-_xtest-1.pck' )
1284- self .failUnless (os .path .exists (heldmsg ))
1284+ self .assertTrue (os .path .exists (heldmsg ))
12851285 os .unlink (heldmsg )
12861286 holdfiles = [f for f in os .listdir (mm_cfg .DATA_DIR )
12871287 if f .startswith ('heldmsg-' )]
@@ -1982,7 +1982,7 @@ def test_normal_archiving(self):
19821982 eq (data ['_parsemsg' ], False )
19831983 eq (data ['version' ], 3 )
19841984 # Clock skew makes this unreliable
1985- #self.failUnless (data['received_time'] <= time.time())
1985+ #self.assertTrue (data['received_time'] <= time.time())
19861986 eq (msg .as_string (unixfrom = 0 ), msg2 .as_string (unixfrom = 0 ))
19871987
19881988
@@ -2093,7 +2093,7 @@ def test_outgoing(self):
20932093 eq (len (files ), 1 )
20942094 msg2 , data = self ._sb .dequeue (files [0 ])
20952095 eq (msg .as_string (unixfrom = 0 ), msg2 .as_string (unixfrom = 0 ))
2096- self .failUnless (len (data ) >= 6 and len (data ) <= 7 )
2096+ self .assertTrue (len (data ) >= 6 and len (data ) <= 7 )
20972097 eq (data ['foo' ], 1 )
20982098 eq (data ['bar' ], 2 )
20992099 eq (data ['version' ], 3 )
@@ -2102,7 +2102,7 @@ def test_outgoing(self):
21022102 # Can't test verp. presence/value depend on mm_cfg.py
21032103 #eq(data['verp'], 1)
21042104 # Clock skew makes this unreliable
2105- #self.failUnless (data['received_time'] <= time.time())
2105+ #self.assertTrue (data['received_time'] <= time.time())
21062106
21072107
21082108
@@ -2150,7 +2150,7 @@ def test_to_usenet(self):
21502150 eq (data ['version' ], 3 )
21512151 eq (data ['listname' ], '_xtest' )
21522152 # Clock skew makes this unreliable
2153- #self.failUnless (data['received_time'] <= time.time())
2153+ #self.assertTrue (data['received_time'] <= time.time())
21542154
21552155
21562156
0 commit comments