summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman/app/tests/test_registrar.py4
-rw-r--r--src/mailman/docs/NEWS.rst4
-rw-r--r--src/mailman/interfaces/pending.py3
-rw-r--r--src/mailman/model/docs/pending.rst4
-rw-r--r--src/mailman/model/pending.py1
-rw-r--r--src/mailman/model/tests/test_usermanager.py1
-rw-r--r--src/mailman/utilities/tests/test_import.py12
7 files changed, 19 insertions, 10 deletions
diff --git a/src/mailman/app/tests/test_registrar.py b/src/mailman/app/tests/test_registrar.py
index 06c22386a..4f5e1e3f9 100644
--- a/src/mailman/app/tests/test_registrar.py
+++ b/src/mailman/app/tests/test_registrar.py
@@ -50,10 +50,10 @@ class TestRegistrar(unittest.TestCase):
def test_unique_token(self):
# Registering a subscription request provides a unique token associated
# with a pendable.
- self.assertEqual(self._pendings.count(), 0)
+ self.assertEqual(self._pendings.count, 0)
token = self._registrar.register(self._anne)
self.assertIsNotNone(token)
- self.assertEqual(self._pendings.count(), 1)
+ self.assertEqual(self._pendings.count, 1)
record = self._pendings.confirm(token, expunge=False)
self.assertEqual(record['list_id'], self._mlist.list_id)
self.assertEqual(record['address'], 'anne@example.com')
diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst
index 68ebe6143..ebe90a6df 100644
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -19,6 +19,10 @@ Architecture
also have a ``is_server_owner`` flag (defaulting to False) to indicate
whether they have superuser privileges. Give by Abhliash Raj, with fixes
and refinements by Barry Warsaw. (LP: #1423756)
+ * Mailing list subscription policy work flow has been completely rewritten.
+ It now properly supports email verification and subscription confirmation
+ by the user, and approval by the moderator using unique tokens.
+ ``IMailingList`` objects now have a ``subscription_policy`` attribute.
Bugs
----
diff --git a/src/mailman/interfaces/pending.py b/src/mailman/interfaces/pending.py
index 7420fcdb2..222f0dfbf 100644
--- a/src/mailman/interfaces/pending.py
+++ b/src/mailman/interfaces/pending.py
@@ -95,5 +95,4 @@ class IPendings(Interface):
def evict():
"""Remove all pended items whose lifetime has expired."""
- def count():
- """The number of pendables in the pendings database."""
+ count = Attribute('The number of pendables in the pendings database.')
diff --git a/src/mailman/model/docs/pending.rst b/src/mailman/model/docs/pending.rst
index 11335f054..4a14edb2a 100644
--- a/src/mailman/model/docs/pending.rst
+++ b/src/mailman/model/docs/pending.rst
@@ -15,7 +15,7 @@ In order to pend an event, you first need a pending database.
There are nothing in the pendings database.
- >>> pendingdb.count()
+ >>> pendingdb.count
0
The pending database can add any ``IPendable`` to the database, returning a
@@ -40,7 +40,7 @@ token that can be used in urls and such.
There's exactly one entry in the pendings database now.
- >>> pendingdb.count()
+ >>> pendingdb.count
1
There's not much you can do with tokens except to *confirm* them, which
diff --git a/src/mailman/model/pending.py b/src/mailman/model/pending.py
index 8eb2ab8ba..bbe95d5f0 100644
--- a/src/mailman/model/pending.py
+++ b/src/mailman/model/pending.py
@@ -166,6 +166,7 @@ class Pendings:
store.delete(keyvalue)
store.delete(pending)
+ @property
@dbconnection
def count(self, store):
return store.query(Pended).count()
diff --git a/src/mailman/model/tests/test_usermanager.py b/src/mailman/model/tests/test_usermanager.py
index e441ed713..f4643f031 100644
--- a/src/mailman/model/tests/test_usermanager.py
+++ b/src/mailman/model/tests/test_usermanager.py
@@ -30,6 +30,7 @@ from mailman.testing.layers import ConfigLayer
from zope.component import getUtility
+
class TestUserManager(unittest.TestCase):
layer = ConfigLayer
diff --git a/src/mailman/utilities/tests/test_import.py b/src/mailman/utilities/tests/test_import.py
index 59387dfa9..9f3d59d5a 100644
--- a/src/mailman/utilities/tests/test_import.py
+++ b/src/mailman/utilities/tests/test_import.py
@@ -306,25 +306,29 @@ class TestBasicImport(unittest.TestCase):
self._mlist.subscription_policy = SubscriptionPolicy.confirm
self._pckdict['subscribe_policy'] = 0
self._import()
- self.assertEqual(self._mlist.subscription_policy, SubscriptionPolicy.open)
+ self.assertEqual(self._mlist.subscription_policy,
+ SubscriptionPolicy.open)
def test_subscription_policy_confirm(self):
self._mlist.subscription_policy = SubscriptionPolicy.open
self._pckdict['subscribe_policy'] = 1
self._import()
- self.assertEqual(self._mlist.subscription_policy, SubscriptionPolicy.confirm)
+ self.assertEqual(self._mlist.subscription_policy,
+ SubscriptionPolicy.confirm)
def test_subscription_policy_moderate(self):
self._mlist.subscription_policy = SubscriptionPolicy.open
self._pckdict['subscribe_policy'] = 2
self._import()
- self.assertEqual(self._mlist.subscription_policy, SubscriptionPolicy.moderate)
+ self.assertEqual(self._mlist.subscription_policy,
+ SubscriptionPolicy.moderate)
def test_subscription_policy_confirm_then_moderate(self):
self._mlist.subscription_policy = SubscriptionPolicy.open
self._pckdict['subscribe_policy'] = 3
self._import()
- self.assertEqual(self._mlist.subscription_policy, SubscriptionPolicy.confirm_then_moderate)
+ self.assertEqual(self._mlist.subscription_policy,
+ SubscriptionPolicy.confirm_then_moderate)