diff options
| author | Barry Warsaw | 2012-01-30 10:37:16 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2012-01-30 10:37:16 -0500 |
| commit | df6ec9f2960f1de89acc17ec28c3fe170a32e1dd (patch) | |
| tree | c212f56d3cb6510362b9f21c8dd625aec450bdd7 /src/mailman/app/tests/test_moderation.py | |
| parent | 78b9ea398e6671d94f958e625b640383f1d43a75 (diff) | |
| download | mailman-df6ec9f2960f1de89acc17ec28c3fe170a32e1dd.tar.gz mailman-df6ec9f2960f1de89acc17ec28c3fe170a32e1dd.tar.zst mailman-df6ec9f2960f1de89acc17ec28c3fe170a32e1dd.zip | |
Diffstat (limited to 'src/mailman/app/tests/test_moderation.py')
| -rw-r--r-- | src/mailman/app/tests/test_moderation.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mailman/app/tests/test_moderation.py b/src/mailman/app/tests/test_moderation.py index 2a75043d5..262aa4480 100644 --- a/src/mailman/app/tests/test_moderation.py +++ b/src/mailman/app/tests/test_moderation.py @@ -29,6 +29,7 @@ import unittest from mailman.app.lifecycle import create_list from mailman.app.moderator import handle_message, hold_message from mailman.interfaces.action import Action +from mailman.interfaces.requests import IListRequests from mailman.runners.incoming import IncomingRunner from mailman.runners.outgoing import OutgoingRunner from mailman.runners.pipeline import PipelineRunner @@ -95,3 +96,16 @@ Message-ID: <alpha> # envelope. self.assertEqual(message['x-mailfrom'], 'test-bounces@example.com') self.assertEqual(message['x-rcptto'], 'bart@example.com') + + def test_hold_action_alias_for_defer(self): + # In handle_message(), the 'hold' action is the same as 'defer' for + # purposes of this API. + request_id = hold_message(self._mlist, self._msg) + handle_message(self._mlist, request_id, Action.defer) + # The message is still in the pending requests. + requests_db = IListRequests(self._mlist) + key, data = requests_db.get_request(request_id) + self.assertEqual(key, '<alpha>') + handle_message(self._mlist, request_id, Action.hold) + key, data = requests_db.get_request(request_id) + self.assertEqual(key, '<alpha>') |
