diff options
Diffstat (limited to 'Mailman/testing')
| -rw-r--r-- | Mailman/testing/test_handlers.py | 22 | ||||
| -rw-r--r-- | Mailman/testing/test_message.py | 4 | ||||
| -rw-r--r-- | Mailman/testing/test_security_mgr.py | 28 |
3 files changed, 27 insertions, 27 deletions
diff --git a/Mailman/testing/test_handlers.py b/Mailman/testing/test_handlers.py index 1c38daa8b..e36af3b0f 100644 --- a/Mailman/testing/test_handlers.py +++ b/Mailman/testing/test_handlers.py @@ -131,7 +131,7 @@ From: aperson@example.org eq(str(str(qmsg['subject'])), '_xtest post acknowledgement') eq(qmsg['to'], 'aperson@example.org') eq(qmsg['from'], '_xtest-bounces@example.com') - eq(qmsg.get_type(), 'text/plain') + eq(qmsg.get_content_type(), 'text/plain') eq(qmsg.get_param('charset'), 'us-ascii') msgid = qmsg['message-id'] self.failUnless(msgid.startswith('<mailman.')) @@ -171,7 +171,7 @@ Subject: Wish you were here eq(str(qmsg['subject']), '_xtest post acknowledgement') eq(qmsg['to'], 'aperson@example.org') eq(qmsg['from'], '_xtest-bounces@example.com') - eq(qmsg.get_type(), 'text/plain') + eq(qmsg.get_content_type(), 'text/plain') eq(qmsg.get_param('charset'), 'us-ascii') msgid = qmsg['message-id'] self.failUnless(msgid.startswith('<mailman.')) @@ -1166,7 +1166,7 @@ yyy MimeDel.process(self._mlist, msg, {}) eq(len(msg.get_payload()), 1) subpart = msg.get_payload(0) - eq(subpart.get_type(), 'image/gif') + eq(subpart.get_content_type(), 'image/gif') eq(subpart.get_payload(), 'yyy') def test_collapse_multipart_alternative(self): @@ -1197,9 +1197,9 @@ yyy """) MimeDel.process(self._mlist, msg, {}) eq(len(msg.get_payload()), 1) - eq(msg.get_type(), 'multipart/mixed') + eq(msg.get_content_type(), 'multipart/mixed') subpart = msg.get_payload(0) - eq(subpart.get_type(), 'image/gif') + eq(subpart.get_content_type(), 'image/gif') eq(subpart.get_payload(), 'yyy') def test_convert_to_plaintext(self): @@ -1217,7 +1217,7 @@ MIME-Version: 1.0 <body></body></html> """) MimeDel.process(self._mlist, msg, {}) - eq(msg.get_type(), 'text/plain') + eq(msg.get_content_type(), 'text/plain') eq(msg.get_payload(), '\n\n\n') def test_deep_structure(self): @@ -1266,13 +1266,13 @@ aaa payload = msg.get_payload() eq(len(payload), 3) part1 = msg.get_payload(0) - eq(part1.get_type(), 'text/plain') + eq(part1.get_content_type(), 'text/plain') eq(part1.get_payload(), 'A different message') part2 = msg.get_payload(1) - eq(part2.get_type(), 'image/gif') + eq(part2.get_content_type(), 'image/gif') eq(part2.get_payload(), 'zzz') part3 = msg.get_payload(2) - eq(part3.get_type(), 'image/gif') + eq(part3.get_content_type(), 'image/gif') eq(part3.get_payload(), 'aaa') def test_top_multipart_alternative(self): @@ -1293,7 +1293,7 @@ This is plain text --AAA-- """) MimeDel.process(self._mlist, msg, {}) - eq(msg.get_type(), 'text/plain') + eq(msg.get_content_type(), 'text/plain') eq(msg.get_payload(), 'This is plain text') @@ -1568,7 +1568,7 @@ Here is message %(i)d # is the RFC 1153 digest. for filebase in files: qmsg, qdata = self._sb.dequeue(filebase) - if qmsg.get_main_type() == 'multipart': + if qmsg.get_content_maintype() == 'multipart': mimemsg = qmsg mimedata = qdata else: diff --git a/Mailman/testing/test_message.py b/Mailman/testing/test_message.py index 822449064..34e5c0139 100644 --- a/Mailman/testing/test_message.py +++ b/Mailman/testing/test_message.py @@ -82,10 +82,10 @@ yadda yadda yadda # second message is the message/rfc822 attachment of the original # message. msg1 = qmsg.get_payload(0) - eq(msg1.get_type(), 'text/plain') + eq(msg1.get_content_type(), 'text/plain') eq(msg1.get_payload(), '[No bounce details are available]') msg2 = qmsg.get_payload(1) - eq(msg2.get_type(), 'message/rfc822') + eq(msg2.get_content_type(), 'message/rfc822') unless(msg2.is_multipart()) msg3 = msg2.get_payload(0) eq(msg3.get_payload(), 'yadda yadda yadda\n') diff --git a/Mailman/testing/test_security_mgr.py b/Mailman/testing/test_security_mgr.py index ea7db5d9f..4b2515140 100644 --- a/Mailman/testing/test_security_mgr.py +++ b/Mailman/testing/test_security_mgr.py @@ -90,8 +90,8 @@ class TestSecurityManager(TestBase): class TestAuthenticate(TestBase): def setUp(self): TestBase.setUp(self) - Utils.set_global_password('bbBBbb', siteadmin=1) - Utils.set_global_password('ccCCcc', siteadmin=0) + Utils.set_global_password('bbBBbb', siteadmin=True) + Utils.set_global_password('ccCCcc', siteadmin=False) def tearDown(self): try: @@ -206,8 +206,8 @@ class StripperIO(StringIO): class TestWebAuthenticate(TestBase): def setUp(self): TestBase.setUp(self) - Utils.set_global_password('bbBBbb', siteadmin=1) - Utils.set_global_password('ccCCcc', siteadmin=0) + Utils.set_global_password('bbBBbb', siteadmin=True) + Utils.set_global_password('ccCCcc', siteadmin=False) mlist = self._mlist mlist.mod_password = password('abcdefg') mlist.addNewMember('aperson@dom.ain', password='qqQQqq') @@ -235,25 +235,25 @@ class TestWebAuthenticate(TestBase): TestBase.tearDown(self) def test_auth_site_admin(self): - self.assertEqual(self._mlist.WebAuthenticate( - [config.AuthSiteAdmin], 'xxxxxx'), 1) + self.failUnless(self._mlist.WebAuthenticate( + [config.AuthSiteAdmin], 'does not matter')) def test_list_admin(self): - self.assertEqual(self._mlist.WebAuthenticate( - [config.AuthListAdmin], 'xxxxxx'), 1) + self.failUnless(self._mlist.WebAuthenticate( + [config.AuthListAdmin], 'does not matter')) def test_list_moderator(self): - self.assertEqual(self._mlist.WebAuthenticate( - [config.AuthListModerator], 'xxxxxx'), 1) + self.failUnless(self._mlist.WebAuthenticate( + [config.AuthListModerator], 'does not matter')) def test_user(self): - self.assertEqual(self._mlist.WebAuthenticate( - [config.AuthUser], 'xxxxxx'), 1) + self.failUnless(self._mlist.WebAuthenticate( + [config.AuthUser], 'does not matter')) def test_not_a_user(self): self._mlist.removeMember('aperson@dom.ain') - self.assertEqual(self._mlist.WebAuthenticate( - [config.AuthUser], 'xxxxxx', 'aperson@dom.ain'), 0) + self.failIf(self._mlist.WebAuthenticate( + [config.AuthUser], 'does not matter', 'aperson@dom.ain')) |
