diff options
| author | Mark Sapiro | 2017-02-12 22:35:10 -0800 |
|---|---|---|
| committer | Mark Sapiro | 2017-02-19 17:44:16 -0800 |
| commit | 0ac6d8273cfb5fb60321867e108a3c6f7cee7bfb (patch) | |
| tree | 08c8fa830fea7b240b642de268f90483c579a7e5 /src/mailman/app/tests/test_lifecycle.py | |
| parent | 9351e5ff1c60394a16ac87690b08abee8e404a32 (diff) | |
| download | mailman-0ac6d8273cfb5fb60321867e108a3c6f7cee7bfb.tar.gz mailman-0ac6d8273cfb5fb60321867e108a3c6f7cee7bfb.tar.zst mailman-0ac6d8273cfb5fb60321867e108a3c6f7cee7bfb.zip | |
Diffstat (limited to 'src/mailman/app/tests/test_lifecycle.py')
| -rw-r--r-- | src/mailman/app/tests/test_lifecycle.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mailman/app/tests/test_lifecycle.py b/src/mailman/app/tests/test_lifecycle.py index db36d0b64..ec7d2b771 100644 --- a/src/mailman/app/tests/test_lifecycle.py +++ b/src/mailman/app/tests/test_lifecycle.py @@ -26,6 +26,7 @@ from mailman.app.lifecycle import ( from mailman.interfaces.address import InvalidEmailAddressError from mailman.interfaces.domain import BadDomainSpecificationError from mailman.interfaces.listmanager import IListManager +from mailman.testing.helpers import LogFileMark, configuration from mailman.testing.layers import ConfigLayer from zope.component import getUtility @@ -46,6 +47,28 @@ class TestLifecycle(unittest.TestCase): self.assertRaises(InvalidListNameError, create_list, 'my/list@example.com') + @configuration('mailman', listname_chars='[a-z0-9-+\]') + def test_bad_config_listname_chars(self): + mark = LogFileMark('mailman.error') + # This list create should succeed but log an error + mlist = create_list('test@example.com') + # Check the error log. + self.assertEqual( + mark.readline()[-83:-1], + 'Bad config.mailman.listname_chars setting: ' + '[a-z0-9-+\]: ' + 'unterminated character set' + ) + # Remove the list. + remove_list(mlist) + + @configuration('mailman', listname_chars='[a-z]') + def test_listname_with_minimal_listname_chars(self): + # This only allows letters in the listname. A listname with digits + # Raises an exception. + self.assertRaises(InvalidListNameError, + create_list, 'list1@example.com') + def test_unregistered_domain(self): # Creating a list with an unregistered domain raises an exception. self.assertRaises(BadDomainSpecificationError, |
