summaryrefslogtreecommitdiff
path: root/src/mailman/rest/tests/test_lists.py
diff options
context:
space:
mode:
authorBarry Warsaw2015-01-04 20:20:33 -0500
committerBarry Warsaw2015-01-04 20:20:33 -0500
commit4a612db8e89afed74173b93f3b64fa567b8417a3 (patch)
tree81a687d113079a25f93279f35c7eee2aa2572510 /src/mailman/rest/tests/test_lists.py
parent84af79988a4e916604cba31843778206efb7d1b8 (diff)
parentde181c1a40965a3a7deedd56a034a946f45b6984 (diff)
downloadmailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.gz
mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.zst
mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.zip
Diffstat (limited to 'src/mailman/rest/tests/test_lists.py')
-rw-r--r--src/mailman/rest/tests/test_lists.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/mailman/rest/tests/test_lists.py b/src/mailman/rest/tests/test_lists.py
index ba6f6ea59..839fd0f58 100644
--- a/src/mailman/rest/tests/test_lists.py
+++ b/src/mailman/rest/tests/test_lists.py
@@ -17,9 +17,6 @@
"""REST list tests."""
-from __future__ import absolute_import, print_function, unicode_literals
-
-__metaclass__ = type
__all__ = [
'TestListArchivers',
'TestListPagination',
@@ -30,14 +27,13 @@ __all__ = [
import unittest
-from urllib2 import HTTPError
-from zope.component import getUtility
-
from mailman.app.lifecycle import create_list
from mailman.database.transaction import transaction
from mailman.interfaces.usermanager import IUserManager
from mailman.testing.helpers import call_api
from mailman.testing.layers import RESTLayer
+from six.moves.urllib_error import HTTPError
+from zope.component import getUtility
@@ -129,7 +125,7 @@ class TestLists(unittest.TestCase):
})
self.assertEqual(cm.exception.code, 400)
self.assertEqual(cm.exception.reason,
- 'Domain does not exist: no-domain.example.org')
+ b'Domain does not exist: no-domain.example.org')
def test_cannot_create_duplicate_list(self):
# You cannot create a list that already exists.
@@ -141,7 +137,7 @@ class TestLists(unittest.TestCase):
'fqdn_listname': 'ant@example.com',
})
self.assertEqual(cm.exception.code, 400)
- self.assertEqual(cm.exception.reason, 'Mailing list exists')
+ self.assertEqual(cm.exception.reason, b'Mailing list exists')
def test_cannot_delete_missing_list(self):
# You cannot delete a list that does not exist.
@@ -220,7 +216,7 @@ class TestListArchivers(unittest.TestCase):
method='PATCH')
self.assertEqual(cm.exception.code, 400)
self.assertEqual(cm.exception.reason,
- 'Unexpected parameters: bogus-archiver')
+ b'Unexpected parameters: bogus-archiver')
def test_put_incomplete_statuses(self):
# PUT requires the full resource representation. This one forgets to
@@ -233,7 +229,7 @@ class TestListArchivers(unittest.TestCase):
method='PUT')
self.assertEqual(cm.exception.code, 400)
self.assertEqual(cm.exception.reason,
- 'Missing parameters: mhonarc, prototype')
+ b'Missing parameters: mhonarc, prototype')
def test_patch_bogus_status(self):
# Archiver statuses must be interpretable as booleans.
@@ -246,7 +242,7 @@ class TestListArchivers(unittest.TestCase):
},
method='PATCH')
self.assertEqual(cm.exception.code, 400)
- self.assertEqual(cm.exception.reason, 'Invalid boolean value: sure')
+ self.assertEqual(cm.exception.reason, b'Invalid boolean value: sure')