diff options
| author | Aurélien Bompard | 2015-06-16 00:04:35 +0200 |
|---|---|---|
| committer | Aurélien Bompard | 2015-06-17 08:24:22 +0200 |
| commit | b0e36af9d28404a54e435d9427ddffb8c7b6d4c3 (patch) | |
| tree | d9b86c415d6a95f1ff67919c3b59e91c4660be03 /src/mailman/utilities/tests/test_import.py | |
| parent | 1e20893957cb7124567d26779db681cf10a91d0e (diff) | |
| download | mailman-b0e36af9d28404a54e435d9427ddffb8c7b6d4c3.tar.gz mailman-b0e36af9d28404a54e435d9427ddffb8c7b6d4c3.tar.zst mailman-b0e36af9d28404a54e435d9427ddffb8c7b6d4c3.zip | |
Diffstat (limited to 'src/mailman/utilities/tests/test_import.py')
| -rw-r--r-- | src/mailman/utilities/tests/test_import.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mailman/utilities/tests/test_import.py b/src/mailman/utilities/tests/test_import.py index aa2888af6..13c23b32c 100644 --- a/src/mailman/utilities/tests/test_import.py +++ b/src/mailman/utilities/tests/test_import.py @@ -648,6 +648,18 @@ class TestRosterImport(unittest.TestCase): 'bob@example.com', 'fred@example.com', ], + 'accept_these_nonmembers': [ + 'gene@example.com', + ], + 'hold_these_nonmembers': [ + 'homer@example.com', + ], + 'reject_these_nonmembers': [ + 'iris@example.com', + ], + 'discard_these_nonmembers': [ + 'kenny@example.com', + ], } self._usermanager = getUtility(IUserManager) language_manager = getUtility(ILanguageManager) @@ -831,6 +843,21 @@ class TestRosterImport(unittest.TestCase): queue, file_count)) self.assertTrue(self._mlist.send_welcome_message) + def test_nonmembers(self): + import_config_pck(self._mlist, self._pckdict) + expected = {"gene": Action.accept, + "homer": Action.hold, + "iris": Action.reject, + "kenny": Action.discard, + } + for name, action in expected.items(): + self.assertIn('{}@example.com'.format(name), + [a.email for a in self._mlist.nonmembers.addresses], + 'Address {} was not imported'.format(name)) + member = self._mlist.nonmembers.get_member( + '{}@example.com'.format(name)) + self.assertEqual(member.moderation_action, action) + class TestPreferencesImport(unittest.TestCase): |
