summaryrefslogtreecommitdiff
path: root/src/mailman/model/tests/test_listmanager.py
diff options
context:
space:
mode:
authorBarry Warsaw2017-06-24 21:57:16 +0000
committerBarry Warsaw2017-06-24 21:57:16 +0000
commite8b134b8f34a8226dd512ecc96a6c908d712663b (patch)
tree9057e4acfb9b4db2c75542d13b41b8938ef99451 /src/mailman/model/tests/test_listmanager.py
parent6a148f762d5ee4fd91505eb0aa165b759899019f (diff)
downloadmailman-e8b134b8f34a8226dd512ecc96a6c908d712663b.tar.gz
mailman-e8b134b8f34a8226dd512ecc96a6c908d712663b.tar.zst
mailman-e8b134b8f34a8226dd512ecc96a6c908d712663b.zip
Diffstat (limited to 'src/mailman/model/tests/test_listmanager.py')
-rw-r--r--src/mailman/model/tests/test_listmanager.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mailman/model/tests/test_listmanager.py b/src/mailman/model/tests/test_listmanager.py
index da65f88ce..da8c4f76f 100644
--- a/src/mailman/model/tests/test_listmanager.py
+++ b/src/mailman/model/tests/test_listmanager.py
@@ -135,6 +135,24 @@ class TestListManager(unittest.TestCase):
self.assertEqual(len(result), 1)
self.assertEqual(result[0], cat)
+ def test_find_by_list_spec(self):
+ ant = create_list('ant@example.com')
+ list_manager = getUtility(IListManager)
+ self.assertEqual(list_manager.get('ant@example.com'), ant)
+ self.assertEqual(list_manager.get('ant.example.com'), ant)
+
+ def test_find_by_list_id(self):
+ ant = create_list('ant@example.com')
+ list_manager = getUtility(IListManager)
+ self.assertEqual(list_manager.get_by_list_id('ant.example.com'), ant)
+ self.assertIsNone(list_manager.get_by_list_id('ant@example.com'))
+
+ def test_find_by_fqdn(self):
+ ant = create_list('ant@example.com')
+ list_manager = getUtility(IListManager)
+ self.assertEqual(list_manager.get_by_fqdn('ant@example.com'), ant)
+ self.assertIsNone(list_manager.get_by_fqdn('ant.example.com'))
+
class TestListLifecycleEvents(unittest.TestCase):
layer = ConfigLayer