launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #25817
Re: [Merge] ~pappacena/launchpad:stormify-bugmessage into launchpad:master
Pushed the requested adjustments.
Diff comments:
> diff --git a/lib/lp/bugs/browser/tests/test_bugtarget_filebug.py b/lib/lp/bugs/browser/tests/test_bugtarget_filebug.py
> index d3efbe2..77bc21c 100644
> --- a/lib/lp/bugs/browser/tests/test_bugtarget_filebug.py
> +++ b/lib/lp/bugs/browser/tests/test_bugtarget_filebug.py
> @@ -588,7 +588,7 @@ class FileBugViewBaseExtraDataTestCase(FileBugViewMixin, TestCaseWithFactory):
> 'Added to the description.',
> bug.description)
> self.assertEqual(2, bug.messages.count())
> - self.assertEqual(bug.bug_messages[-1], message_event.object)
> + self.assertEqual(list(bug.bug_messages)[-1], message_event.object)
Ok!
> notifications = [
> no.message for no in view.request.response.notifications]
> self.assertContentEqual(
> diff --git a/lib/lp/bugs/model/bugmessage.py b/lib/lp/bugs/model/bugmessage.py
> index 653f893..6da4d70 100644
> --- a/lib/lp/bugs/model/bugmessage.py
> +++ b/lib/lp/bugs/model/bugmessage.py
> @@ -81,15 +96,20 @@ class BugMessageSet:
>
> def get(self, bugmessageid):
> """See `IBugMessageSet`."""
> - return BugMessage.get(bugmessageid)
> + store = IStore(BugMessage)
> + return store.find(BugMessage, BugMessage.id == bugmessageid).one()
Ok!
>
> def getByBugAndMessage(self, bug, message):
> """See`IBugMessageSet`."""
> - return BugMessage.selectOneBy(bug=bug, message=message)
> + store = IStore(BugMessage)
> + return store.find(
> + BugMessage,
> + BugMessage.bug == bug, BugMessage.message == message).one()
Ok!
>
> def getImportedBugMessages(self, bug):
> """See IBugMessageSet."""
> - return BugMessage.select("""
> - BugMessage.bug = %s
> - AND BugMessage.bugwatch IS NOT NULL
> - """ % sqlvalues(bug), orderBy='id')
> + store = IStore(BugMessage)
> + resultset = store.find(
> + BugMessage,
> + BugMessage.bug == bug, BugMessage.bugwatch != None)
> + return resultset.order_by(BugMessage.id)
--
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/394993
Your team Launchpad code reviewers is subscribed to branch ~pappacena/launchpad:stormify-bugmessage.
References