summaryrefslogtreecommitdiff
path: root/Mailman/testing/test_message.py
diff options
context:
space:
mode:
authorbwarsaw2006-07-08 18:02:57 +0000
committerbwarsaw2006-07-08 18:02:57 +0000
commitc6bd2024ebcb3982bb07c3fed1bb13d7ded332bd (patch)
treef94e3945ec69c35be0bad5abeaa71df53b535351 /Mailman/testing/test_message.py
parentf321ff8f419284c32f7eea4e06c83212bccef6b0 (diff)
downloadmailman-c6bd2024ebcb3982bb07c3fed1bb13d7ded332bd.tar.gz
mailman-c6bd2024ebcb3982bb07c3fed1bb13d7ded332bd.tar.zst
mailman-c6bd2024ebcb3982bb07c3fed1bb13d7ded332bd.zip
Fix some buglets with virtual domain support and repair unit tests broken by
this change. More unit tests should be added. misc/sitelist.cfg is removed -- this is an ex-site list. MailList.GetNoReplyEmail() -> MailList.no_reply_address (property) UserNotification._enqueue(), OwnerNotification._enqueue(): when queing the message to the virgin queue, be sure to use the fully qualified (i.e. posting) address for the list. In the MTA modules, be sure to set up the target of the mail commands as the fqdn listname because otherwise we can't find the correct list. This needs some tweaking/testing for Postfix's virtual domain support. MailList.Load() has to grow an optional argument specifying the fqdn listname. The problem is that in some situations, we can't calculate that because we don't know _internal_name, so it has to be passed in. This is mostly the case in the MailList ctor where a Load hasn't happened yet. For backward compatibility though, if it's not passed in, just use mlist.fqdn_listname.
Diffstat (limited to 'Mailman/testing/test_message.py')
-rw-r--r--Mailman/testing/test_message.py33
1 files changed, 17 insertions, 16 deletions
diff --git a/Mailman/testing/test_message.py b/Mailman/testing/test_message.py
index 504adfc9e..822449064 100644
--- a/Mailman/testing/test_message.py
+++ b/Mailman/testing/test_message.py
@@ -32,43 +32,44 @@ class TestSentMessage(EmailBase):
eq = self.assertEqual
unless = self.failUnless
msg = Message.UserNotification(
- 'aperson@dom.ain',
- '_xtest@dom.ain',
+ 'aperson@example.org',
+ '_xtest@example.com',
'Your Test List',
'About your test list')
msg.send(self._mlist)
qmsg = email.message_from_string(self._readmsg())
eq(qmsg['subject'], 'Your Test List')
- eq(qmsg['from'], '_xtest@dom.ain')
- eq(qmsg['to'], 'aperson@dom.ain')
+ eq(qmsg['from'], '_xtest@example.com')
+ eq(qmsg['to'], 'aperson@example.org')
# The Message-ID: header has some time-variant information
msgid = qmsg['message-id']
unless(msgid.startswith('<mailman.'))
- unless(msgid.endswith('._xtest@dom.ain>'))
- eq(qmsg['sender'], '_xtest-bounces@dom.ain')
- eq(qmsg['errors-to'], '_xtest-bounces@dom.ain')
- eq(qmsg['x-beenthere'], '_xtest@dom.ain')
+ unless(msgid.endswith('._xtest@example.com>'))
+ eq(qmsg['sender'], '_xtest-bounces@example.com')
+ eq(qmsg['errors-to'], '_xtest-bounces@example.com')
+ eq(qmsg['x-beenthere'], '_xtest@example.com')
eq(qmsg['x-mailman-version'], Version.VERSION)
eq(qmsg['precedence'], 'bulk')
# UserNotifications have reduced_list_headers so it won't have
# List-Help, List-Subscribe, or List-Unsubscribe. XXX Why would that
# possibly be?
- eq(qmsg['list-help'], '<mailto:_xtest-request@dom.ain?subject=help>')
+ eq(qmsg['list-help'],
+ '<mailto:_xtest-request@example.com?subject=help>')
eq(qmsg['list-subscribe'], """\
-<http://www.dom.ain/mailman/listinfo/_xtest>,
-\t<mailto:_xtest-request@dom.ain?subject=subscribe>""")
- eq(qmsg['list-id'], '<_xtest.dom.ain>')
+<http://www.example.com/mailman/listinfo/_xtest>,
+\t<mailto:_xtest-request@example.com?subject=subscribe>""")
+ eq(qmsg['list-id'], '<_xtest.example.com>')
eq(qmsg['list-unsubscribe'], """\
-<http://www.dom.ain/mailman/listinfo/_xtest>,
-\t<mailto:_xtest-request@dom.ain?subject=unsubscribe>""")
+<http://www.example.com/mailman/listinfo/_xtest>,
+\t<mailto:_xtest-request@example.com?subject=unsubscribe>""")
eq(qmsg.get_payload(), 'About your test list')
def test_bounce_message(self):
eq = self.assertEqual
unless = self.failUnless
msg = email.message_from_string("""\
-To: _xtest@dom.ain
-From: nobody@dom.ain
+To: _xtest@example.com
+From: nobody@example.com
Subject: and another thing
yadda yadda yadda