← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:fix-py3-rework-bug-authentication-tests into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:fix-py3-rework-bug-authentication-tests into launchpad:master.

Commit message:
Fix nondeterminism in test_no_commands_with_weak_authentication

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/397589

Bug.messages isn't ordered in the right way to make TestAuthenticationRequirements.test_no_commands_with_weak_authentication reliable.  Use Bug.bug_messages instead, which is ordered by the message index.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:fix-py3-rework-bug-authentication-tests into launchpad:master.
diff --git a/lib/lp/bugs/mail/tests/test_handler.py b/lib/lp/bugs/mail/tests/test_handler.py
index 6994404..eeebc9f 100644
--- a/lib/lp/bugs/mail/tests/test_handler.py
+++ b/lib/lp/bugs/mail/tests/test_handler.py
@@ -737,4 +737,4 @@ class TestAuthenticationRequirements(TestCaseWithFactory):
         self.assertEmailQueueLength(0)
         self.assertEqual(
             'I really hope this bug gets fixed.',
-            bug.messages[0].text_contents)
+            bug.bug_messages.last().message.text_contents)