diff options
| author | Barry Warsaw | 2015-01-04 20:20:33 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2015-01-04 20:20:33 -0500 |
| commit | 4a612db8e89afed74173b93f3b64fa567b8417a3 (patch) | |
| tree | 81a687d113079a25f93279f35c7eee2aa2572510 /src/mailman/rules/tests/test_approved.py | |
| parent | 84af79988a4e916604cba31843778206efb7d1b8 (diff) | |
| parent | de181c1a40965a3a7deedd56a034a946f45b6984 (diff) | |
| download | mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.gz mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.zst mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.zip | |
Diffstat (limited to 'src/mailman/rules/tests/test_approved.py')
| -rw-r--r-- | src/mailman/rules/tests/test_approved.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/mailman/rules/tests/test_approved.py b/src/mailman/rules/tests/test_approved.py index 9976d4eff..83088da55 100644 --- a/src/mailman/rules/tests/test_approved.py +++ b/src/mailman/rules/tests/test_approved.py @@ -17,9 +17,6 @@ """Test the `approved` handler.""" -from __future__ import absolute_import, print_function, unicode_literals - -__metaclass__ = type __all__ = [ 'TestApproved', 'TestApprovedNonASCII', @@ -36,8 +33,7 @@ from mailman.app.lifecycle import create_list from mailman.config import config from mailman.rules import approved from mailman.testing.helpers import ( - configuration, - specialized_message_from_string as mfs) + configuration, specialized_message_from_string as mfs) from mailman.testing.layers import ConfigLayer @@ -433,7 +429,7 @@ class TestPasswordHashMigration(unittest.TestCase): # hash is chosen after the original password is set. As long as the # old password still validates, the migration happens automatically. self._mlist.moderator_password = config.password_context.encrypt( - b'super secret') + 'super secret') self._rule = approved.Approved() self._msg = mfs("""\ From: anne@example.com @@ -450,7 +446,7 @@ A message body. # hashing algorithm. When the old password is validated, it will be # automatically migrated to the new hash. self.assertEqual(self._mlist.moderator_password, - b'{plaintext}super secret') + '{plaintext}super secret') config_file = os.path.join(config.VAR_DIR, 'passlib.config') # XXX passlib seems to choose the default hashing scheme even if it is # deprecated. The default scheme is either specified explicitly, or @@ -466,14 +462,14 @@ deprecated = roundup_plaintext self._msg['Approved'] = 'super secret' result = self._rule.check(self._mlist, self._msg, {}) self.assertTrue(result) - self.assertEqual(self._mlist.moderator_password, b'super secret') + self.assertEqual(self._mlist.moderator_password, 'super secret') def test_invalid_password_does_not_migrate(self): # Now that the moderator password is set, change the default password # hashing algorithm. When the old password is invalid, it will not be # automatically migrated to the new hash. self.assertEqual(self._mlist.moderator_password, - b'{plaintext}super secret') + '{plaintext}super secret') config_file = os.path.join(config.VAR_DIR, 'passlib.config') # XXX passlib seems to choose the default hashing scheme even if it is # deprecated. The default scheme is either specified explicitly, or @@ -490,9 +486,10 @@ deprecated = roundup_plaintext result = self._rule.check(self._mlist, self._msg, {}) self.assertFalse(result) self.assertEqual(self._mlist.moderator_password, - b'{plaintext}super secret') + '{plaintext}super secret') + class TestApprovedNoTextPlainPart(unittest.TestCase): """Test the approved handler with HTML-only messages.""" |
