Public bug reported:
Tests fail with
Failure in test test_accepted_message_gets_posted (mailman.app.tests.test_moderation.TestModeration) Traceback (most recent call last): File "/usr/lib64/python2.7/unittest/case.py", line 318, in run testMethod() File "/home/devel/mailman/src/mailman/app/tests/test_moderation.py", line 83, in test_accepted_message_gets_posted 'Mon, 01 Aug 2005 07:49:23 -') File "/usr/lib64/python2.7/unittest/case.py", line 494, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib64/python2.7/unittest/case.py", line 487, in _baseAssertEqual raise self.failureException(msg) AssertionError: 'Mon, 01 Aug 2005 07:49:23 +' != u'Mon, 01 Aug 2005 07:49:23 -'
which seems to include remnants of UTC offset in its comparison
perhaps it should be
mailman/src/mailman/app/tests/test_moderation.py: line 82
self.assertEqual(message['x-mailman-approved-at'][:-5], 'Mon, 01 Aug 2005 07:49:23 ')
** Affects: mailman Importance: Undecided Status: New
** Patch added: "diff from "bzr diff -p1 test_moder..."" https://bugs.launchpad.net/bugs/890675/+attachment/2597687/+files/test_moder...
** Tags added: mailman3
Why is a '-' at the end of date ?
I have changed it to '+' and it works!
But i don't know whether it is correct way to rectify the error.
** Patch added: "time.diff" https://bugs.launchpad.net/mailman/+bug/890675/+attachment/2749070/+files/ti...
Aamir, the '-' at the end of the date is left over from trying to strip out the timezone information, which will be different everywhere you run the test suite. Because that's unpredictable data, it must be removed from the test output, or you'll get the failure as you've seen. blacktav's diff in comment #1 is the more correct fix for this problem, because it correctly strips off the +- sign, which indicates whether your timezone is east or west of UTC. Because I'm west of UTC, it's negative for me. I'm guessing your east of UTC, so that's why it is positive for you.
This is definitely an easy fix, but here is my suggestion: why don't you create a branch of lp:mailman, apply blacktav's patch and run the test suite to ensure that it fixes the failure. If so, learn how to use bzr to commit the change locally, and then push your branch to Launchpad, using something like lp:~sys3mw0rm/mailman/bug-890675. Then you can use `bzr lp-propose` to submit a merge proposal into trunk. Please include a NEWS.rst file entry (see examples in that file) and please do give due credit to blacktav as well.
Once you've submitted the merge proposal, I'll review it and commit it to trunk. This will give you a great opportunity to learn a bit about the code, and how we accept contributions. Ping me on IRC if you have questions.
** Changed in: mailman Status: New => Confirmed
** Changed in: mailman Importance: Undecided => Medium
** Changed in: mailman Milestone: None => 3.0.0b1
** Changed in: mailman Assignee: (unassigned) => Aamir Khan (syst3mw0rm)
** Changed in: mailman Status: Confirmed => Fix Committed
** Changed in: mailman Status: Fix Committed => Fix Released