summaryrefslogtreecommitdiff
path: root/src/mailman/app/tests
diff options
context:
space:
mode:
authorAurélien Bompard2015-03-27 12:53:59 +0100
committerAurélien Bompard2015-03-27 12:53:59 +0100
commit2e4367b6aaba7b16a371cc98036ce2cbdeb35fbf (patch)
tree68d127c3c712e426f3ad506e2b9844f1b0f00698 /src/mailman/app/tests
parent7f5d0e4d2b1d4043247543bb9c067d96e8280c2d (diff)
downloadmailman-2e4367b6aaba7b16a371cc98036ce2cbdeb35fbf.tar.gz
mailman-2e4367b6aaba7b16a371cc98036ce2cbdeb35fbf.tar.zst
mailman-2e4367b6aaba7b16a371cc98036ce2cbdeb35fbf.zip
Workflow: allow saving and restoring with an empty queue
Diffstat (limited to 'src/mailman/app/tests')
-rw-r--r--src/mailman/app/tests/test_subscriptions.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mailman/app/tests/test_subscriptions.py b/src/mailman/app/tests/test_subscriptions.py
index fde33b91e..05646c929 100644
--- a/src/mailman/app/tests/test_subscriptions.py
+++ b/src/mailman/app/tests/test_subscriptions.py
@@ -100,6 +100,21 @@ class TestSubscriptionWorkflow(unittest.TestCase):
self.assertEqual(workflow.pre_confirmed, False)
self.assertEqual(workflow.pre_approved, False)
+ def test_save_restore_no_next_step(self):
+ anne = self._user_manager.create_address(self._anne, 'Anne Person')
+ workflow = SubscriptionWorkflow(
+ self._mlist, anne,
+ pre_verified=True, pre_confirmed=False, pre_approved=False)
+ workflow._next.pop()
+ self.assertEqual(len(workflow._next), 0)
+ workflow.save_state()
+ # Now create a new instance and restore
+ workflow = SubscriptionWorkflow(
+ self._mlist, anne,
+ pre_verified=None, pre_confirmed=None, pre_approved=None)
+ workflow.restore_state()
+ self.assertEqual(len(workflow._next), 0)
+
def test_preverified_address_joins_open_list(self):
# The mailing list has an open subscription policy, so the subscriber
# becomes a member with no human intervention.