diff options
| author | Barry Warsaw | 2017-02-06 15:30:01 +0000 |
|---|---|---|
| committer | Barry Warsaw | 2017-02-06 15:30:01 +0000 |
| commit | 03e04a93efa312bfec58dd267959d401e9bcf22b (patch) | |
| tree | db590d461c1e9c956c1f562f826d8ba0ddf405b3 /src/mailman/rest/tests/test_basic.py | |
| parent | a75a718fa9073a51df8ce4deafe8a4851818b0a7 (diff) | |
| parent | 26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc (diff) | |
| download | mailman-03e04a93efa312bfec58dd267959d401e9bcf22b.tar.gz mailman-03e04a93efa312bfec58dd267959d401e9bcf22b.tar.zst mailman-03e04a93efa312bfec58dd267959d401e9bcf22b.zip | |
Diffstat (limited to 'src/mailman/rest/tests/test_basic.py')
| -rw-r--r-- | src/mailman/rest/tests/test_basic.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mailman/rest/tests/test_basic.py b/src/mailman/rest/tests/test_basic.py index 2799c6f83..16ec2f5a3 100644 --- a/src/mailman/rest/tests/test_basic.py +++ b/src/mailman/rest/tests/test_basic.py @@ -27,6 +27,7 @@ from mailman.database.transaction import transaction from mailman.testing.helpers import call_api from mailman.testing.layers import RESTLayer from urllib.error import HTTPError +from urllib.request import urlopen class TestBasicREST(unittest.TestCase): @@ -39,7 +40,7 @@ class TestBasicREST(unittest.TestCase): self._mlist = create_list('test@example.com') def test_comma_fields(self): - resource, response = call_api( + json, response = call_api( 'http://localhost:9001/3.0/lists/test@example.com/config', dict(description='A description with , to check stuff'), method='PATCH') @@ -50,6 +51,8 @@ class TestBasicREST(unittest.TestCase): def test_send_error(self): # GL#288 working around Python bug #28548. The improperly encoded # space in the URL breaks error reporting due to default HTTP/0.9. + # Use urllib.request since requests will encode the URL, defeating the + # purpose of this test (i.e. we want the literal space, not %20). with self.assertRaises(HTTPError) as cm: - call_api('http://localhost:9001/3.0/lists/test @example.com') + urlopen('http://localhost:9001/3.0/lists/test @example.com') self.assertEqual(cm.exception.code, 400) |
