summaryrefslogtreecommitdiff
path: root/src/mailman/rest/tests/test_moderation.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/rest/tests/test_moderation.py')
-rw-r--r--src/mailman/rest/tests/test_moderation.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mailman/rest/tests/test_moderation.py b/src/mailman/rest/tests/test_moderation.py
index 262a7ec60..c77ae2aca 100644
--- a/src/mailman/rest/tests/test_moderation.py
+++ b/src/mailman/rest/tests/test_moderation.py
@@ -29,6 +29,7 @@ from mailman.app.moderator import hold_message, hold_subscription
from mailman.config import config
from mailman.database.transaction import transaction
from mailman.interfaces.member import DeliveryMode
+from mailman.interfaces.subscriptions import RequestRecord
from mailman.testing.helpers import (
call_api, specialized_message_from_string as mfs)
from mailman.testing.layers import RESTLayer
@@ -76,8 +77,9 @@ Something else.
# in the database.
held_id = hold_message(self._mlist, self._msg)
subscribe_id = hold_subscription(
- self._mlist, 'bperson@example.net', 'Bart Person', 'xyz',
- DeliveryMode.regular, 'en')
+ self._mlist,
+ RequestRecord('bperson@example.net', 'Bart Person',
+ DeliveryMode.regular, 'en'))
config.db.store.commit()
url = 'http://localhost:9001/3.0/lists/ant@example.com/held/{0}'
with self.assertRaises(HTTPError) as cm:
@@ -114,8 +116,9 @@ Something else.
def test_bad_subscription_action(self):
# POSTing to a held message with a bad action.
held_id = hold_subscription(
- self._mlist, 'cperson@example.net', 'Cris Person', 'xyz',
- DeliveryMode.regular, 'en')
+ self._mlist,
+ RequestRecord('cperson@example.net', 'Cris Person',
+ DeliveryMode.regular, 'en'))
config.db.store.commit()
url = 'http://localhost:9001/3.0/lists/ant@example.com/requests/{0}'
with self.assertRaises(HTTPError) as cm: