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
1=== modified file 'lib/lp/bugs/interfaces/bugwatch.py'
2--- lib/lp/bugs/interfaces/bugwatch.py 2010-04-27 17:41:44 +0000
3+++ lib/lp/bugs/interfaces/bugwatch.py 2010-04-27 23:26:24 +0000
4@@ -355,7 +355,9 @@
5 or None.
6 """
7
8- def bulkAddActivity(bug_watches, result=None, message=None, oops_id=None):
9+ def bulkAddActivity(bug_watches,
10+ result=BugWatchActivityStatus.SYNC_SUCCEEDED,
11+ message=None, oops_id=None):
12 """Efficiently add activity for the given bug watches.
13
14 Add `BugWatchActivity` records for the given bug watches in
15
16=== modified file 'lib/lp/bugs/model/bugwatch.py'
17--- lib/lp/bugs/model/bugwatch.py 2010-04-27 17:41:44 +0000
18+++ lib/lp/bugs/model/bugwatch.py 2010-04-27 23:26:24 +0000
19@@ -713,8 +713,9 @@
20 last_error_type=last_error_type,
21 next_check=None)
22
23- def bulkAddActivity(self, bug_watches, result=None, message=None,
24- oops_id=None):
25+ def bulkAddActivity(self, bug_watches,
26+ result=BugWatchActivityStatus.SYNC_SUCCEEDED,
27+ message=None, oops_id=None):
28 """See `IBugWatchSet`."""
29 bug_watch_ids = set(
30 (bug_watch.id if IBugWatch.providedBy(bug_watch) else bug_watch)
31
32=== modified file 'lib/lp/bugs/tests/test_bugwatch.py'
33--- lib/lp/bugs/tests/test_bugwatch.py 2010-04-27 17:41:44 +0000
34+++ lib/lp/bugs/tests/test_bugwatch.py 2010-04-27 23:26:24 +0000
35@@ -507,7 +507,8 @@
36 # Called with only bug watches, bulkAddActivity() adds
37 # successful activity records for the given bug watches.
38 getUtility(IBugWatchSet).bulkAddActivity(self.bug_watches)
39- self._checkActivityForBugWatches(None, None, None)
40+ self._checkActivityForBugWatches(
41+ BugWatchActivityStatus.SYNC_SUCCEEDED, None, None)
42
43 def test_bulkAddActivity_with_error(self):
44 # Called with additional error information, bulkAddActivity()
45@@ -522,7 +523,8 @@
46 # The ids of bug watches can be passed in.
47 getUtility(IBugWatchSet).bulkAddActivity(
48 [bug_watch.id for bug_watch in self.bug_watches])
49- self._checkActivityForBugWatches(None, None, None)
50+ self._checkActivityForBugWatches(
51+ BugWatchActivityStatus.SYNC_SUCCEEDED, None, None)
52
53 def test_bulkAddActivity_with_mixed_list(self):
54 # The list passed in can contain a mix of bug watches and
55@@ -530,13 +532,15 @@
56 getUtility(IBugWatchSet).bulkAddActivity(
57 [bug_watch.id for bug_watch in self.bug_watches[::2]] +
58 [bug_watch for bug_watch in self.bug_watches[1::2]])
59- self._checkActivityForBugWatches(None, None, None)
60+ self._checkActivityForBugWatches(
61+ BugWatchActivityStatus.SYNC_SUCCEEDED, None, None)
62
63 def test_bulkAddActivity_with_iterator(self):
64 # Any iterator can be passed in.
65 getUtility(IBugWatchSet).bulkAddActivity(
66 (bug_watch for bug_watch in self.bug_watches))
67- self._checkActivityForBugWatches(None, None, None)
68+ self._checkActivityForBugWatches(
69+ BugWatchActivityStatus.SYNC_SUCCEEDED, None, None)
70
71
72 class TestBugWatchBugTasks(TestCaseWithFactory):

Subscribers

People subscribed via source and target branches

to status/vote changes: