Merge lp:~mwhudson/launchpad/db-devel into lp:launchpad/db-devel

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the revision history of the source branch.
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/db-devel
Merge into: lp:launchpad/db-devel
Diff against target: 72 lines (+14/-7)
3 files modified
lib/lp/bugs/interfaces/bugwatch.py (+3/-1)
lib/lp/bugs/model/bugwatch.py (+3/-2)
lib/lp/bugs/tests/test_bugwatch.py (+8/-4)
To merge this branch: bzr merge lp:~mwhudson/launchpad/db-devel
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+24270@code.launchpad.net

Commit message

Fix integration problem wrt non-NULL-ness of BugWatchActivity.result betweeen stable and db-devel

Description of the change

Hi,

This branch fixes tests on db-devel. Basically BugWatchActivity.result has a not-NULL constraint in db-devel, but a recent change on devel has a default argument that ends up in that column that is None. So I changed the default.

Cheers,
mwh

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) :
review: Approve
lp:~mwhudson/launchpad/db-devel updated
9307. By Launchpad PQM Bot

[testfix][r=thumper][ui=none] Fix integration problem wrt
 non-NULL-ness of BugWatchActivity.result betweeen stable and db-devel

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/interfaces/bugwatch.py'
--- lib/lp/bugs/interfaces/bugwatch.py 2010-04-27 17:41:44 +0000
+++ lib/lp/bugs/interfaces/bugwatch.py 2010-04-27 23:26:24 +0000
@@ -355,7 +355,9 @@
355 or None.355 or None.
356 """356 """
357357
358 def bulkAddActivity(bug_watches, result=None, message=None, oops_id=None):358 def bulkAddActivity(bug_watches,
359 result=BugWatchActivityStatus.SYNC_SUCCEEDED,
360 message=None, oops_id=None):
359 """Efficiently add activity for the given bug watches.361 """Efficiently add activity for the given bug watches.
360362
361 Add `BugWatchActivity` records for the given bug watches in363 Add `BugWatchActivity` records for the given bug watches in
362364
=== modified file 'lib/lp/bugs/model/bugwatch.py'
--- lib/lp/bugs/model/bugwatch.py 2010-04-27 17:41:44 +0000
+++ lib/lp/bugs/model/bugwatch.py 2010-04-27 23:26:24 +0000
@@ -713,8 +713,9 @@
713 last_error_type=last_error_type,713 last_error_type=last_error_type,
714 next_check=None)714 next_check=None)
715715
716 def bulkAddActivity(self, bug_watches, result=None, message=None,716 def bulkAddActivity(self, bug_watches,
717 oops_id=None):717 result=BugWatchActivityStatus.SYNC_SUCCEEDED,
718 message=None, oops_id=None):
718 """See `IBugWatchSet`."""719 """See `IBugWatchSet`."""
719 bug_watch_ids = set(720 bug_watch_ids = set(
720 (bug_watch.id if IBugWatch.providedBy(bug_watch) else bug_watch)721 (bug_watch.id if IBugWatch.providedBy(bug_watch) else bug_watch)
721722
=== modified file 'lib/lp/bugs/tests/test_bugwatch.py'
--- lib/lp/bugs/tests/test_bugwatch.py 2010-04-27 17:41:44 +0000
+++ lib/lp/bugs/tests/test_bugwatch.py 2010-04-27 23:26:24 +0000
@@ -507,7 +507,8 @@
507 # Called with only bug watches, bulkAddActivity() adds507 # Called with only bug watches, bulkAddActivity() adds
508 # successful activity records for the given bug watches.508 # successful activity records for the given bug watches.
509 getUtility(IBugWatchSet).bulkAddActivity(self.bug_watches)509 getUtility(IBugWatchSet).bulkAddActivity(self.bug_watches)
510 self._checkActivityForBugWatches(None, None, None)510 self._checkActivityForBugWatches(
511 BugWatchActivityStatus.SYNC_SUCCEEDED, None, None)
511512
512 def test_bulkAddActivity_with_error(self):513 def test_bulkAddActivity_with_error(self):
513 # Called with additional error information, bulkAddActivity()514 # Called with additional error information, bulkAddActivity()
@@ -522,7 +523,8 @@
522 # The ids of bug watches can be passed in.523 # The ids of bug watches can be passed in.
523 getUtility(IBugWatchSet).bulkAddActivity(524 getUtility(IBugWatchSet).bulkAddActivity(
524 [bug_watch.id for bug_watch in self.bug_watches])525 [bug_watch.id for bug_watch in self.bug_watches])
525 self._checkActivityForBugWatches(None, None, None)526 self._checkActivityForBugWatches(
527 BugWatchActivityStatus.SYNC_SUCCEEDED, None, None)
526528
527 def test_bulkAddActivity_with_mixed_list(self):529 def test_bulkAddActivity_with_mixed_list(self):
528 # The list passed in can contain a mix of bug watches and530 # The list passed in can contain a mix of bug watches and
@@ -530,13 +532,15 @@
530 getUtility(IBugWatchSet).bulkAddActivity(532 getUtility(IBugWatchSet).bulkAddActivity(
531 [bug_watch.id for bug_watch in self.bug_watches[::2]] +533 [bug_watch.id for bug_watch in self.bug_watches[::2]] +
532 [bug_watch for bug_watch in self.bug_watches[1::2]])534 [bug_watch for bug_watch in self.bug_watches[1::2]])
533 self._checkActivityForBugWatches(None, None, None)535 self._checkActivityForBugWatches(
536 BugWatchActivityStatus.SYNC_SUCCEEDED, None, None)
534537
535 def test_bulkAddActivity_with_iterator(self):538 def test_bulkAddActivity_with_iterator(self):
536 # Any iterator can be passed in.539 # Any iterator can be passed in.
537 getUtility(IBugWatchSet).bulkAddActivity(540 getUtility(IBugWatchSet).bulkAddActivity(
538 (bug_watch for bug_watch in self.bug_watches))541 (bug_watch for bug_watch in self.bug_watches))
539 self._checkActivityForBugWatches(None, None, None)542 self._checkActivityForBugWatches(
543 BugWatchActivityStatus.SYNC_SUCCEEDED, None, None)
540544
541545
542class TestBugWatchBugTasks(TestCaseWithFactory):546class TestBugWatchBugTasks(TestCaseWithFactory):

Subscribers

People subscribed via source and target branches

to status/vote changes: