launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #19420
[Merge] lp:~cjwatson/launchpad/testfix-import-warnings into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/testfix-import-warnings into lp:launchpad.
Commit message:
Listify result of getBySubscriberWithActiveToken to avoid doing the eager load twice.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/testfix-import-warnings/+merge/272228
Listify result of getBySubscriberWithActiveToken to avoid doing the eager load twice.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/testfix-import-warnings into lp:launchpad.
=== modified file 'lib/lp/soyuz/browser/archivesubscription.py'
--- lib/lp/soyuz/browser/archivesubscription.py 2015-09-23 15:43:43 +0000
+++ lib/lp/soyuz/browser/archivesubscription.py 2015-09-24 11:39:50 +0000
@@ -320,8 +320,8 @@
cleaner.
"""
subscriber_set = getUtility(IArchiveSubscriberSet)
- subs_with_tokens = subscriber_set.getBySubscriberWithActiveToken(
- self.context)
+ subs_with_tokens = list(
+ subscriber_set.getBySubscriberWithActiveToken(self.context))
# ArchiveSubscriber.archive is preloaded.
archives = [subscriber.archive for subscriber, _ in subs_with_tokens]
=== modified file 'lib/lp/soyuz/tests/test_archive_subscriptions.py'
--- lib/lp/soyuz/tests/test_archive_subscriptions.py 2015-01-07 11:26:05 +0000
+++ lib/lp/soyuz/tests/test_archive_subscriptions.py 2015-09-24 11:39:50 +0000
@@ -3,6 +3,7 @@
"""Test Archive features."""
+from fixtures import FakeLogger
from storm.store import Store
from testtools.matchers import Equals
from zope.security.interfaces import Unauthorized
@@ -161,6 +162,7 @@
self.assertIsNotNone(find_tag_by_id(content, 'ppa-install'))
def test_unauthorized_subscriber_for_plus_packages(self):
+ self.useFixture(FakeLogger())
with person_logged_in(self.owner):
self.archive.newSubscription(
self.subscriber, registrant=self.archive.owner)
@@ -191,7 +193,7 @@
view = create_initialized_view(
subscriber, '+archivesubscriptions', principal=subscriber)
view.render()
- self.assertThat(recorder, HasQueryCount(Equals(13)))
+ self.assertThat(recorder, HasQueryCount(Equals(12)))
def test_getArchiveSubscriptions(self):
# Anyone with 'View' permission on a given person is able to
Follow ups