diff options
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): |
