diff options
| -rw-r--r-- | src/mailman/app/tests/test_moderation.py | 16 | ||||
| -rw-r--r-- | src/mailman/chains/tests/test_hold.py | 6 | ||||
| -rw-r--r-- | src/mailman/docs/NEWS.rst | 1 |
3 files changed, 18 insertions, 5 deletions
diff --git a/src/mailman/app/tests/test_moderation.py b/src/mailman/app/tests/test_moderation.py index 59e9f3643..2f7970cce 100644 --- a/src/mailman/app/tests/test_moderation.py +++ b/src/mailman/app/tests/test_moderation.py @@ -56,6 +56,10 @@ Message-ID: <alpha> self._in = make_testable_runner(IncomingRunner, 'in') self._pipeline = make_testable_runner(PipelineRunner, 'pipeline') self._out = make_testable_runner(OutgoingRunner, 'out') + # Python 2.7 has assertMultiLineEqual + self.maxDiff = None + self.eq = getattr(self, 'assertMultiLineEqual', + getattr(self, 'assertEqual')) def test_accepted_message_gets_posted(self): # A message that is accepted by the moderator should get posted to the @@ -75,11 +79,15 @@ Message-ID: <alpha> del message['x-mailman-version'] self.assertTrue('x-peer' in message) del message['x-peer'] - self.assertEqual(message.as_string(), """\ + # 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> -X-Mailman-Approved-At: Mon, 01 Aug 2005 07:49:23 -0400 Subject: [Test] hold me X-BeenThere: test@example.com Precedence: list @@ -87,10 +95,10 @@ 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> + <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> + <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 diff --git a/src/mailman/chains/tests/test_hold.py b/src/mailman/chains/tests/test_hold.py index 3e9f66084..b3e9815d5 100644 --- a/src/mailman/chains/tests/test_hold.py +++ b/src/mailman/chains/tests/test_hold.py @@ -46,6 +46,10 @@ class TestAutorespond(unittest.TestCase): def setUp(self): self._mlist = create_list('test@example.com') + # Python 2.7 has assertMultiLineEqual + self.maxDiff = None + self.eq = getattr(self, 'assertMultiLineEqual', + getattr(self, 'assertEqual')) def test_max_autoresponses_per_day(self): # The last one we sent was the last one we should send today. Instead @@ -73,7 +77,7 @@ class TestAutorespond(unittest.TestCase): del message['message-id'] self.assertTrue('date' in message) del message['date'] - self.assertEqual(messages[0].msg.as_string(), """\ + self.eq(messages[0].msg.as_string(), """\ MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst index 360a340dc..402e194a1 100644 --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -70,6 +70,7 @@ Other bugs * Moderating a message with Action.accept now sends the message. (LP: #827697) * Fix AttributeError triggered by i18n call in autorespond_to_sender() (LP: #827060) + * Local timezone in X-Mailman-Approved-At caused test failure. (LP: #832404) 3.0 alpha 7 -- "Mission" |
