← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wallyworld/launchpad/testfix-rev-16155 into lp:launchpad

 

Ian Booth has proposed merging lp:~wallyworld/launchpad/testfix-rev-16155 into lp:launchpad.

Commit message:
Test fix for rev 16155 - tweak a test and invalidate bug dupes in markAffectedUser

Requested reviews:
  Ian Booth (wallyworld)
Related bugs:
  Bug #1066647 in Launchpad itself: "Bug.markUserAffected makes a query for every duplicate bug"
  https://bugs.launchpad.net/launchpad/+bug/1066647

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/testfix-rev-16155/+merge/130017

Test fix for rev 16155 - tweak a test and invalidate bug dupes in markAffectedUser
-- 
https://code.launchpad.net/~wallyworld/launchpad/testfix-rev-16155/+merge/130017
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/bugs/browser/tests/test_bug_views.py'
--- lib/lp/bugs/browser/tests/test_bug_views.py	2012-10-12 06:17:20 +0000
+++ lib/lp/bugs/browser/tests/test_bug_views.py	2012-10-17 01:40:24 +0000
@@ -320,7 +320,7 @@
         bug = self.factory.makeBug()
         for n in range(20):
             dupe = self.factory.makeBug()
-            removeSecurityProxy(dupe)._markAsDuplicate(bug)
+            removeSecurityProxy(dupe)._markAsDuplicate(bug, set())
             removeSecurityProxy(dupe).subscribe(user, dupe.owner)
         Store.of(bug).invalidate()
         with person_logged_in(user):

=== modified file 'lib/lp/bugs/model/bug.py'
--- lib/lp/bugs/model/bug.py	2012-10-17 00:28:37 +0000
+++ lib/lp/bugs/model/bug.py	2012-10-17 01:40:24 +0000
@@ -1892,6 +1892,8 @@
                 BugAffectsPerson.person == user,
                 BugAffectsPerson.bugID.is_in(dupe_bug_ids),
             ).set(affected=affected)
+            for dupe in self.duplicates:
+                dupe._flushAndInvalidate()
         self._flushAndInvalidate()
 
         if affected:


Follow ups