diff options
| author | Mark Sapiro | 2017-02-19 17:37:05 -0800 |
|---|---|---|
| committer | Mark Sapiro | 2017-02-19 17:44:16 -0800 |
| commit | c39ef107c1765f1eb937bfcaae2e23dda0b4c581 (patch) | |
| tree | c7df0bb15b8631d12284dcc548e49b6d37569f70 /src/mailman/rest/tests/test_lists.py | |
| parent | 1bde5f4b0f91831b22ebba135dc361ad9d622b3e (diff) | |
| download | mailman-c39ef107c1765f1eb937bfcaae2e23dda0b4c581.tar.gz mailman-c39ef107c1765f1eb937bfcaae2e23dda0b4c581.tar.zst mailman-c39ef107c1765f1eb937bfcaae2e23dda0b4c581.zip | |
Diffstat (limited to 'src/mailman/rest/tests/test_lists.py')
| -rw-r--r-- | src/mailman/rest/tests/test_lists.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mailman/rest/tests/test_lists.py b/src/mailman/rest/tests/test_lists.py index 7bb7bd333..75a81f3cb 100644 --- a/src/mailman/rest/tests/test_lists.py +++ b/src/mailman/rest/tests/test_lists.py @@ -129,6 +129,28 @@ class TestLists(unittest.TestCase): self.assertEqual(cm.exception.reason, 'Domain does not exist: no-domain.example.org') + def test_cannot_create_list_with_invalid_posting_address(self): + # You cannot create a mailing list which would have an invalid list + # posting address. + with self.assertRaises(HTTPError) as cm: + call_api('http://localhost:9001/3.0/lists', { + 'fqdn_listname': '@example.com', + }) + self.assertEqual(cm.exception.code, 400) + self.assertEqual(cm.exception.reason, + 'Invalid list posting address: @example.com') + + def test_cannot_create_list_with_invalid_name(self): + # You cannot create a mailing list which would have an invalid list + # posting address. + with self.assertRaises(HTTPError) as cm: + call_api('http://localhost:9001/3.0/lists', { + 'fqdn_listname': 'a/list@example.com', + }) + self.assertEqual(cm.exception.code, 400) + self.assertEqual(cm.exception.reason, + 'Invalid list name: a/list') + def test_cannot_create_duplicate_list(self): # You cannot create a list that already exists. call_api('http://localhost:9001/3.0/lists', { |
