summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2011-09-07 14:56:43 -0400
committerBarry Warsaw2011-09-07 14:56:43 -0400
commit04346ba3154f94775f9cd693a73209848ab26dfc (patch)
treedb34e8d44d10510d5406dc609e04c4f569c5d503 /src
parent340c25de0f8fdd2c4093cf233cd4e999bff52856 (diff)
downloadmailman-04346ba3154f94775f9cd693a73209848ab26dfc.tar.gz
mailman-04346ba3154f94775f9cd693a73209848ab26dfc.tar.zst
mailman-04346ba3154f94775f9cd693a73209848ab26dfc.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/app/tests/test_moderation.py39
-rw-r--r--src/mailman/docs/NEWS.rst1
2 files changed, 16 insertions, 24 deletions
diff --git a/src/mailman/app/tests/test_moderation.py b/src/mailman/app/tests/test_moderation.py
index 2f7970cce..c96430c64 100644
--- a/src/mailman/app/tests/test_moderation.py
+++ b/src/mailman/app/tests/test_moderation.py
@@ -74,37 +74,28 @@ Message-ID: <alpha>
messages = list(SMTPLayer.smtpd.messages)
self.assertEqual(len(messages), 1)
message = messages[0]
- # Delete variable headers which can't be compared.
+ # We don't need to test the entire posted message, just the bits that
+ # prove it got sent out.
self.assertTrue('x-mailman-version' in message)
- del message['x-mailman-version']
self.assertTrue('x-peer' in message)
- del message['x-peer']
# The X-Mailman-Approved-At header has local timezone information in
# it, so test that separately.
self.assertEqual(message['x-mailman-approved-at'][:-4],
'Mon, 01 Aug 2005 07:49:23 -')
del message['x-mailman-approved-at']
- self.eq(message.as_string(), """\
-From: anne@example.com
-To: test@example.com
-Message-ID: <alpha>
-Subject: [Test] hold me
-X-BeenThere: test@example.com
-Precedence: list
-List-Id: <test.example.com>
-X-Message-ID-Hash: XZ3DGG4V37BZTTLXNUX4NABB4DNQHTCP
-List-Post: <mailto:test@example.com>
-List-Subscribe: <http://lists.example.com/listinfo/test@example.com>,
- <mailto:test-join@example.com>
-Archived-At: http://lists.example.com/archives/XZ3DGG4V37BZTTLXNUX4NABB4DNQHTCP
-List-Unsubscribe: <http://lists.example.com/listinfo/test@example.com>,
- <mailto:test-leave@example.com>
-List-Archive: <http://lists.example.com/archives/test@example.com>
-List-Help: <mailto:test-request@example.com?subject=help>
-X-MailFrom: test-bounces@example.com
-X-RcptTo: bart@example.com
-
-""")
+ # The Message-ID matches the original.
+ self.assertEqual(message['message-id'], '<alpha>')
+ # Anne sent the message and the mailing list received it.
+ self.assertEqual(message['from'], 'anne@example.com')
+ self.assertEqual(message['to'], 'test@example.com')
+ # The Subject header has the list's prefix.
+ self.assertEqual(message['subject'], '[Test] hold me')
+ # The list's -bounce address is the actual sender, and Bart is the
+ # only actual recipient. These headers are added by the testing
+ # framework and don't show up in production. They match the RFC 5321
+ # envelope.
+ self.assertEqual(message['x-mailfrom'], 'test-bounces@example.com')
+ self.assertEqual(message['x-rcptto'], 'bart@example.com')
diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst
index 2b8a99d28..548632a85 100644
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -89,6 +89,7 @@ Other bugs and changes
(LP: #827060)
* Local timezone in X-Mailman-Approved-At caused test failure. (LP: #832404)
* InvalidEmailAddressError no longer repr()'s its value.
+ * Rewrote a test for compatibility between Python 2.6 and 2.7. (LP: #833208)
3.0 alpha 7 -- "Mission"