summaryrefslogtreecommitdiff
path: root/src/mailman/app
diff options
context:
space:
mode:
authorBarry Warsaw2015-04-16 15:28:06 -0400
committerBarry Warsaw2015-04-16 15:28:06 -0400
commit53d4229bff96677a54fd443322c166c2bdcc3054 (patch)
treeff233bc6fa95d24bc4e66c8192d10c1b87ed2efc /src/mailman/app
parentc5e63e32bd713ef6b3ba05cec5cdc4926a44bcc5 (diff)
downloadmailman-53d4229bff96677a54fd443322c166c2bdcc3054.tar.gz
mailman-53d4229bff96677a54fd443322c166c2bdcc3054.tar.zst
mailman-53d4229bff96677a54fd443322c166c2bdcc3054.zip
Checkpointing.
Diffstat (limited to 'src/mailman/app')
-rw-r--r--src/mailman/app/subscriptions.py3
-rw-r--r--src/mailman/app/tests/test_subscriptions.py16
2 files changed, 18 insertions, 1 deletions
diff --git a/src/mailman/app/subscriptions.py b/src/mailman/app/subscriptions.py
index 1c6b96016..46ce549af 100644
--- a/src/mailman/app/subscriptions.py
+++ b/src/mailman/app/subscriptions.py
@@ -24,7 +24,6 @@ __all__ = [
]
-
import uuid
import logging
@@ -170,6 +169,8 @@ class SubscriptionWorkflow(Workflow):
pendable = Pendable(
list_id=self.mlist.list_id,
address=self.address.email,
+ hold_date=now().replace(microsecond=0).isoformat(),
+ token_owner=token_owner.name,
)
self.token = getUtility(IPendings).add(pendable, timedelta(days=3650))
diff --git a/src/mailman/app/tests/test_subscriptions.py b/src/mailman/app/tests/test_subscriptions.py
index 732266ac3..6b5d88026 100644
--- a/src/mailman/app/tests/test_subscriptions.py
+++ b/src/mailman/app/tests/test_subscriptions.py
@@ -57,6 +57,22 @@ class TestSubscriptionWorkflow(unittest.TestCase):
self.assertEqual(workflow.token_owner, TokenOwner.no_one)
self.assertIsNone(workflow.member)
+ def test_pended_data(self):
+ # There is a Pendable associated with the held request, and it has
+ # some data associated with it.
+ anne = self._user_manager.create_address(self._anne)
+ workflow = SubscriptionWorkflow(self._mlist, anne)
+ try:
+ workflow.run_thru('send_confirmation')
+ except StopIteration:
+ pass
+ self.assertIsNotNone(workflow.token)
+ pendable = getUtility(IPendings).confirm(workflow.token, expunge=False)
+ self.assertEqual(pendable['list_id'], 'test.example.com')
+ self.assertEqual(pendable['address'], 'anne@example.com')
+ self.assertEqual(pendable['hold_date'], '2005-08-01T07:49:23')
+ self.assertEqual(pendable['token_owner'], 'subscriber')
+
def test_user_or_address_required(self):
# The `subscriber` attribute must be a user or address.
workflow = SubscriptionWorkflow(self._mlist)