diff options
| author | J08nY | 2017-07-14 23:32:43 +0200 |
|---|---|---|
| committer | J08nY | 2017-07-14 23:32:43 +0200 |
| commit | 29054076f039fb5525c04ef74ca53a89c429cc33 (patch) | |
| tree | 286ed45589563cc8f3c07396345c89c1b07bb36e | |
| parent | f54c045519300f6f70947d1114f46c2b8ae0d368 (diff) | |
| download | mailman-29054076f039fb5525c04ef74ca53a89c429cc33.tar.gz mailman-29054076f039fb5525c04ef74ca53a89c429cc33.tar.zst mailman-29054076f039fb5525c04ef74ca53a89c429cc33.zip | |
| -rw-r--r-- | src/mailman/commands/tests/test_confirm.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mailman/commands/tests/test_confirm.py b/src/mailman/commands/tests/test_confirm.py index 1ef392b76..80ce01ceb 100644 --- a/src/mailman/commands/tests/test_confirm.py +++ b/src/mailman/commands/tests/test_confirm.py @@ -32,6 +32,7 @@ from mailman.testing.helpers import ( get_queue_messages, make_testable_runner, specialized_message_from_string as mfs, subscribe) from mailman.testing.layers import ConfigLayer +from mailman.utilities.datetime import now from zope.component import getUtility @@ -173,3 +174,33 @@ Confirmed - Done. """.format(token)) + + +class TestConfirmMismatch(unittest.TestCase): + layer = ConfigLayer + + def setUp(self): + self.one_mlist = create_list('one@example.com') + self.other_mlist = create_list('other@example.com') + + self.address = getUtility(IUserManager).create_address( + 'anne@example.com', 'display name') + self.address.verified_on = now() + + def test_confirm_mismatch(self): + self.one_mlist.subscription_policy = SubscriptionPolicy.confirm + self.other_mlist.subscription_policy = SubscriptionPolicy.confirm + + token, token_owner, member = ISubscriptionManager( + self.one_mlist).register(self.address) + + confirm = Message() + confirm['From'] = self.address.email + confirm['To'] = self.other_mlist.confirm_address(token) + confirm['Subject'] = 'Re: confirm {}'.format(token) + confirm.set_payload('') + + config.switchboards['command'].enqueue(confirm, + listid='other.example.com') + make_testable_runner(CommandRunner, 'command').run() + self.assertFalse(self.other_mlist.is_subscribed(self.address)) |
