aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2017-03-05 21:25:38 -0800
committerMark Sapiro <mark@msapiro.net>2017-03-05 21:25:38 -0800
commit956a56fbded78f34ea06e561de5930463e94098b (patch)
treefd13d68f988c1e9f007c06e6001982b56b03b338 /tests
parent2c34348878f40b9a0fe9784baf89d02cb3dac252 (diff)
downloadmailman2-956a56fbded78f34ea06e561de5930463e94098b.tar.gz
mailman2-956a56fbded78f34ea06e561de5930463e94098b.tar.xz
mailman2-956a56fbded78f34ea06e561de5930463e94098b.zip
Updated test_message.py to account for optional Sender: and VERP.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_message.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/test_message.py b/tests/test_message.py
index 00f524f4..0d2cb622 100644
--- a/tests/test_message.py
+++ b/tests/test_message.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2010 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -51,8 +51,14 @@ class TestSentMessage1(EmailBase):
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')
+ # The Sender: header is optional and addresses can be VERPed
+ if self._mlist.include_sender_header:
+ sender = qmsg['sender']
+ unless(sender.startswith('"_xtest" <_xtest-bounces'))
+ unless(sender.endswith('@dom.ain>'))
+ eto = qmsg['errors-to']
+ unless(eto.startswith('_xtest-bounces'))
+ unless(eto.endswith('@dom.ain'))
eq(qmsg['x-beenthere'], '_xtest@dom.ain')
eq(qmsg['x-mailman-version'], Version.VERSION)
eq(qmsg['precedence'], 'bulk')