summaryrefslogtreecommitdiff
path: root/Mailman/testing/test_handlers.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-06-19 11:13:09 -0400
committerBarry Warsaw2007-06-19 11:13:09 -0400
commit0514aa46113f1f44dcf86f2d8ae6f86b71e88a3d (patch)
tree67fe896a40781ed0a64656c3f0fce0fd4278240f /Mailman/testing/test_handlers.py
parentc7d4e4c593d3bb1356fc099581d6f3e3deb0c1d4 (diff)
downloadmailman-0514aa46113f1f44dcf86f2d8ae6f86b71e88a3d.tar.gz
mailman-0514aa46113f1f44dcf86f2d8ae6f86b71e88a3d.tar.zst
mailman-0514aa46113f1f44dcf86f2d8ae6f86b71e88a3d.zip
Diffstat (limited to 'Mailman/testing/test_handlers.py')
-rw-r--r--Mailman/testing/test_handlers.py98
1 files changed, 0 insertions, 98 deletions
diff --git a/Mailman/testing/test_handlers.py b/Mailman/testing/test_handlers.py
index 9c236584f..bbc7f5ba8 100644
--- a/Mailman/testing/test_handlers.py
+++ b/Mailman/testing/test_handlers.py
@@ -39,7 +39,6 @@ from Mailman.testing.base import TestBase
from Mailman.Handlers import Acknowledge
from Mailman.Handlers import AfterDelivery
from Mailman.Handlers import Approve
-from Mailman.Handlers import CalcRecips
from Mailman.Handlers import Cleanse
from Mailman.Handlers import CookHeaders
from Mailman.Handlers import FileRecips
@@ -138,102 +137,6 @@ X-BeenThere: %s
-class TestCalcRecips(TestBase):
- def setUp(self):
- TestBase.setUp(self)
- # Add a bunch of regular members
- mlist = self._mlist
- mlist.addNewMember('aperson@example.org')
- mlist.addNewMember('bperson@example.com')
- mlist.addNewMember('cperson@example.com')
- # And a bunch of digest members
- mlist.addNewMember('dperson@example.com', digest=1)
- mlist.addNewMember('eperson@example.com', digest=1)
- mlist.addNewMember('fperson@example.com', digest=1)
-
- def test_short_circuit(self):
- msgdata = {'recips': 1}
- rtn = CalcRecips.process(self._mlist, None, msgdata)
- # Not really a great test, but there's little else to assert
- self.assertEqual(rtn, None)
-
- def test_simple_path(self):
- msgdata = {}
- msg = email.message_from_string("""\
-From: dperson@example.com
-
-""", Message.Message)
- CalcRecips.process(self._mlist, msg, msgdata)
- self.failUnless(msgdata.has_key('recips'))
- recips = msgdata['recips']
- recips.sort()
- self.assertEqual(recips, ['aperson@example.org', 'bperson@example.com',
- 'cperson@example.com'])
-
- def test_exclude_sender(self):
- msgdata = {}
- msg = email.message_from_string("""\
-From: cperson@example.com
-
-""", Message.Message)
- self._mlist.setMemberOption('cperson@example.com',
- config.DontReceiveOwnPosts, 1)
- CalcRecips.process(self._mlist, msg, msgdata)
- self.failUnless(msgdata.has_key('recips'))
- recips = msgdata['recips']
- recips.sort()
- self.assertEqual(recips, ['aperson@example.org', 'bperson@example.com'])
-
- def test_urgent_moderator(self):
- self._mlist.mod_password = password('xxXXxx')
- msgdata = {}
- msg = email.message_from_string("""\
-From: dperson@example.com
-Urgent: xxXXxx
-
-""", Message.Message)
- CalcRecips.process(self._mlist, msg, msgdata)
- self.failUnless(msgdata.has_key('recips'))
- recips = msgdata['recips']
- recips.sort()
- self.assertEqual(recips, ['aperson@example.org', 'bperson@example.com',
- 'cperson@example.com', 'dperson@example.com',
- 'eperson@example.com', 'fperson@example.com'])
-
- def test_urgent_admin(self):
- self._mlist.mod_password = password('yyYYyy')
- self._mlist.password = password('xxXXxx')
- msgdata = {}
- msg = email.message_from_string("""\
-From: dperson@example.com
-Urgent: xxXXxx
-
-""", Message.Message)
- CalcRecips.process(self._mlist, msg, msgdata)
- self.failUnless(msgdata.has_key('recips'))
- recips = msgdata['recips']
- recips.sort()
- self.assertEqual(recips, ['aperson@example.org', 'bperson@example.com',
- 'cperson@example.com', 'dperson@example.com',
- 'eperson@example.com', 'fperson@example.com'])
-
- def test_urgent_reject(self):
- self._mlist.mod_password = password('yyYYyy')
- self._mlist.password = password('xxXXxx')
- msgdata = {}
- msg = email.message_from_string("""\
-From: dperson@example.com
-Urgent: zzZZzz
-
-""", Message.Message)
- self.assertRaises(Errors.RejectMessage,
- CalcRecips.process,
- self._mlist, msg, msgdata)
-
- # BAW: must test the do_topic_filters() path...
-
-
-
class TestCleanse(TestBase):
def setUp(self):
TestBase.setUp(self)
@@ -1560,7 +1463,6 @@ Mailman rocks!
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestApprove))
- suite.addTest(unittest.makeSuite(TestCalcRecips))
suite.addTest(unittest.makeSuite(TestCleanse))
suite.addTest(unittest.makeSuite(TestCookHeaders))
suite.addTest(unittest.makeSuite(TestFileRecips))