summaryrefslogtreecommitdiff
path: root/src/mailman/chains/tests/test_hold.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-07-06 21:08:41 -0400
committerBarry Warsaw2012-07-06 21:08:41 -0400
commit8d8ab1655b51e277570005b445d3b014afcfbc57 (patch)
tree6ba0147d975636e129a787c9dfa64dae8cffae89 /src/mailman/chains/tests/test_hold.py
parentcd3f84b301c2150fea5402129a2e7bc862fbb52b (diff)
parent01415190ab44e69a8f09a6411564a7cb288404e8 (diff)
downloadmailman-8d8ab1655b51e277570005b445d3b014afcfbc57.tar.gz
mailman-8d8ab1655b51e277570005b445d3b014afcfbc57.tar.zst
mailman-8d8ab1655b51e277570005b445d3b014afcfbc57.zip
Diffstat (limited to 'src/mailman/chains/tests/test_hold.py')
-rw-r--r--src/mailman/chains/tests/test_hold.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mailman/chains/tests/test_hold.py b/src/mailman/chains/tests/test_hold.py
index f2cd1dabf..515894505 100644
--- a/src/mailman/chains/tests/test_hold.py
+++ b/src/mailman/chains/tests/test_hold.py
@@ -30,10 +30,9 @@ from zope.component import getUtility
from mailman.app.lifecycle import create_list
from mailman.chains.hold import autorespond_to_sender
-from mailman.config import config
from mailman.interfaces.autorespond import IAutoResponseSet, Response
from mailman.interfaces.usermanager import IUserManager
-from mailman.testing.helpers import get_queue_messages
+from mailman.testing.helpers import configuration, get_queue_messages
from mailman.testing.layers import ConfigLayer
@@ -49,15 +48,12 @@ class TestAutorespond(unittest.TestCase):
self.maxDiff = None
self.eq = getattr(self, 'assertMultiLineEqual', self.assertEqual)
+ @configuration('mta', max_autoresponses_per_day=1)
def test_max_autoresponses_per_day(self):
# The last one we sent was the last one we should send today. Instead
# of sending an automatic response, send them the "no more today"
- # message.
- config.push('max-1', """
- [mta]
- max_autoresponses_per_day: 1
- """)
- # Simulate a response having been sent to an address already.
+ # message. Start by simulating a response having been sent to an
+ # address already.
anne = getUtility(IUserManager).create_address('anne@example.com')
response_set = IAutoResponseSet(self._mlist)
response_set.response_sent(anne, Response.hold)