Merge lp:~cjwatson/launchpad/quieten-tests into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18383
Proposed branch: lp:~cjwatson/launchpad/quieten-tests
Merge into: lp:launchpad
Diff against target: 447 lines (+55/-25)
14 files modified
lib/lp/app/tests/test_services.py (+4/-1)
lib/lp/blueprints/browser/tests/test_specification.py (+3/-1)
lib/lp/bugs/model/tests/test_bugtask.py (+4/-4)
lib/lp/code/browser/tests/test_branch.py (+3/-1)
lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+5/-1)
lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py (+4/-1)
lib/lp/registry/browser/tests/test_packaging.py (+3/-6)
lib/lp/registry/browser/tests/test_person.py (+6/-3)
lib/lp/registry/browser/tests/test_reassign_team_view.py (+3/-1)
lib/lp/services/features/browser/tests/test_feature_editor.py (+6/-1)
lib/lp/services/webapp/tests/test_publication.py (+4/-1)
lib/lp/translations/browser/tests/test_distribution_views.py (+3/-1)
lib/lp/translations/scripts/tests/test_remove_translations.py (+4/-2)
lib/lp/translations/tests/test_autoapproval.py (+3/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad/quieten-tests
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+323918@code.launchpad.net

Commit message

Quieten some tests with noisy output.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/app/tests/test_services.py'
--- lib/lp/app/tests/test_services.py 2015-07-08 16:05:11 +0000
+++ lib/lp/app/tests/test_services.py 2017-05-11 14:53:15 +0000
@@ -1,8 +1,9 @@
1# Copyright 2012 Canonical Ltd. This software is licensed under the1# Copyright 2012-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for core services infrastructure."""4"""Tests for core services infrastructure."""
55
6from fixtures import FakeLogger
6from lazr.restful.interfaces._rest import IHTTPResource7from lazr.restful.interfaces._rest import IHTTPResource
7from zope.component import getUtility8from zope.component import getUtility
8from zope.interface import implementer9from zope.interface import implementer
@@ -49,12 +50,14 @@
4950
50 def test_invalid_traversal(self):51 def test_invalid_traversal(self):
51 # Test that traversal to +services without a service specified fails.52 # Test that traversal to +services without a service specified fails.
53 self.useFixture(FakeLogger())
52 self.assertRaises(54 self.assertRaises(
53 NotFound, self.getUserBrowser,55 NotFound, self.getUserBrowser,
54 'https://launchpad.dev/api/devel/+services')56 'https://launchpad.dev/api/devel/+services')
5557
56 def test_invalid_service(self):58 def test_invalid_service(self):
57 # Test that traversal an invalid service name fails.59 # Test that traversal an invalid service name fails.
60 self.useFixture(FakeLogger())
58 self.assertRaises(61 self.assertRaises(
59 NotFound, self.getUserBrowser,62 NotFound, self.getUserBrowser,
60 'https://launchpad.dev/api/devel/+services/invalid')63 'https://launchpad.dev/api/devel/+services/invalid')
6164
=== modified file 'lib/lp/blueprints/browser/tests/test_specification.py'
--- lib/lp/blueprints/browser/tests/test_specification.py 2015-06-25 07:39:40 +0000
+++ lib/lp/blueprints/browser/tests/test_specification.py 2017-05-11 14:53:15 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2013 Canonical Ltd. This software is licensed under the1# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4__metaclass__ = type4__metaclass__ = type
@@ -9,6 +9,7 @@
9import unittest9import unittest
1010
11from BeautifulSoup import BeautifulSoup11from BeautifulSoup import BeautifulSoup
12from fixtures import FakeLogger
12from lazr.restful.interfaces import IJSONRequestCache13from lazr.restful.interfaces import IJSONRequestCache
13import pytz14import pytz
14import soupmatchers15import soupmatchers
@@ -187,6 +188,7 @@
187 def test_private_specification_without_authorization(self):188 def test_private_specification_without_authorization(self):
188 # Users without access get a 404 when trying to view private189 # Users without access get a 404 when trying to view private
189 # specifications.190 # specifications.
191 self.useFixture(FakeLogger())
190 owner = self.factory.makePerson()192 owner = self.factory.makePerson()
191 policy = SpecificationSharingPolicy.PROPRIETARY193 policy = SpecificationSharingPolicy.PROPRIETARY
192 product = self.factory.makeProduct(owner=owner,194 product = self.factory.makeProduct(owner=owner,
193195
=== modified file 'lib/lp/bugs/model/tests/test_bugtask.py'
--- lib/lp/bugs/model/tests/test_bugtask.py 2016-05-05 08:23:13 +0000
+++ lib/lp/bugs/model/tests/test_bugtask.py 2017-05-11 14:53:15 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the1# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4__metaclass__ = type4__metaclass__ = type
@@ -84,7 +84,7 @@
84 )84 )
85from lp.services.features.testing import FeatureFixture85from lp.services.features.testing import FeatureFixture
86from lp.services.job.tests import block_on_job86from lp.services.job.tests import block_on_job
87from lp.services.log.logger import FakeLogger87from lp.services.log.logger import DevNullLogger
88from lp.services.propertycache import get_property_cache88from lp.services.propertycache import get_property_cache
89from lp.services.searchbuilder import any89from lp.services.searchbuilder import any
90from lp.services.webapp.authorization import check_permission90from lp.services.webapp.authorization import check_permission
@@ -3154,7 +3154,7 @@
3154 "/var/lock/launchpad-launchpad-targetnamecacheupdater.lock")))3154 "/var/lock/launchpad-launchpad-targetnamecacheupdater.lock")))
3155 self.assertTrue('INFO Updating targetname cache of bugtasks' in err)3155 self.assertTrue('INFO Updating targetname cache of bugtasks' in err)
3156 self.assertTrue('INFO Calculating targets.' in err)3156 self.assertTrue('INFO Calculating targets.' in err)
3157 self.assertTrue('INFO Will check ', err)3157 self.assertTrue('INFO Will check ' in err)
3158 self.assertTrue("INFO Updating (u'Mozilla Thunderbird',)" in err)3158 self.assertTrue("INFO Updating (u'Mozilla Thunderbird',)" in err)
3159 self.assertTrue('INFO Updated 1 target names.' in err)3159 self.assertTrue('INFO Updated 1 target names.' in err)
3160 self.assertTrue('INFO Finished updating targetname cache' in err)3160 self.assertTrue('INFO Finished updating targetname cache' in err)
@@ -3218,7 +3218,7 @@
3218 self.assertEqual(upstream_task.bugtargetdisplayname,3218 self.assertEqual(upstream_task.bugtargetdisplayname,
3219 u'Mozilla Thunderbird NG')3219 u'Mozilla Thunderbird NG')
32203220
3221 logger = FakeLogger()3221 logger = DevNullLogger()
3222 updater = BugTaskTargetNameCacheUpdater(transaction, logger)3222 updater = BugTaskTargetNameCacheUpdater(transaction, logger)
3223 updater.run()3223 updater.run()
32243224
32253225
=== modified file 'lib/lp/code/browser/tests/test_branch.py'
--- lib/lp/code/browser/tests/test_branch.py 2016-11-11 14:24:38 +0000
+++ lib/lp/code/browser/tests/test_branch.py 2017-05-11 14:53:15 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the1# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Unit tests for BranchView."""4"""Unit tests for BranchView."""
@@ -9,6 +9,7 @@
9from textwrap import dedent9from textwrap import dedent
1010
11from BeautifulSoup import BeautifulSoup11from BeautifulSoup import BeautifulSoup
12from fixtures import FakeLogger
12import pytz13import pytz
13from storm.store import Store14from storm.store import Store
14from testtools.matchers import Equals15from testtools.matchers import Equals
@@ -664,6 +665,7 @@
664665
665 def test_anonymous_view_branch_with_private_owner(self):666 def test_anonymous_view_branch_with_private_owner(self):
666 # A branch with a private owner is not rendered for anon users.667 # A branch with a private owner is not rendered for anon users.
668 self.useFixture(FakeLogger())
667 private_owner = self.factory.makeTeam(669 private_owner = self.factory.makeTeam(
668 visibility=PersonVisibility.PRIVATE)670 visibility=PersonVisibility.PRIVATE)
669 with person_logged_in(private_owner):671 with person_logged_in(private_owner):
670672
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-10-14 16:16:18 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2017-05-11 14:53:15 +0000
@@ -1,4 +1,4 @@
1# Copyright 2010-2016 Canonical Ltd. This software is licensed under the1# Copyright 2010-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for the source package recipe view classes and templates."""4"""Tests for the source package recipe view classes and templates."""
@@ -14,6 +14,7 @@
14from textwrap import dedent14from textwrap import dedent
1515
16from BeautifulSoup import BeautifulSoup16from BeautifulSoup import BeautifulSoup
17from fixtures import FakeLogger
17from mechanize import LinkNotFoundError18from mechanize import LinkNotFoundError
18from pytz import UTC19from pytz import UTC
19from testtools.matchers import Equals20from testtools.matchers import Equals
@@ -390,6 +391,7 @@
390 layer = DatabaseFunctionalLayer391 layer = DatabaseFunctionalLayer
391392
392 def test_create_new_recipe_not_logged_in(self):393 def test_create_new_recipe_not_logged_in(self):
394 self.useFixture(FakeLogger())
393 product = self.factory.makeProduct(395 product = self.factory.makeProduct(
394 name='ratatouille', displayname='Ratatouille')396 name='ratatouille', displayname='Ratatouille')
395 branch = self.makeBranch(397 branch = self.makeBranch(
@@ -1576,6 +1578,7 @@
15761578
1577 def test_request_builds_action_not_logged_in(self):1579 def test_request_builds_action_not_logged_in(self):
1578 """Requesting a build creates pending builds."""1580 """Requesting a build creates pending builds."""
1581 self.useFixture(FakeLogger())
1579 self._makeWoodyDistroSeries()1582 self._makeWoodyDistroSeries()
1580 recipe = self.makeRecipe()1583 recipe = self.makeRecipe()
1581 browser = self.getViewBrowser(recipe, no_login=True)1584 browser = self.getViewBrowser(recipe, no_login=True)
@@ -1927,6 +1930,7 @@
1927 browser.url)1930 browser.url)
19281931
1929 def test_delete_recipe_no_permissions(self):1932 def test_delete_recipe_no_permissions(self):
1933 self.useFixture(FakeLogger())
1930 branch = self.makeBranch()1934 branch = self.makeBranch()
1931 recipe = self.factory.makeSourcePackageRecipe(1935 recipe = self.factory.makeSourcePackageRecipe(
1932 owner=self.chef, branches=[branch])1936 owner=self.chef, branches=[branch])
19331937
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py 2015-09-11 14:23:02 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py 2017-05-11 14:53:15 +0000
@@ -1,9 +1,10 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the1# Copyright 2010-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
3"""Tests for the source package recipe view classes and templates."""3"""Tests for the source package recipe view classes and templates."""
44
5__metaclass__ = type5__metaclass__ = type
66
7from fixtures import FakeLogger
7from mechanize import LinkNotFoundError8from mechanize import LinkNotFoundError
8from storm.locals import Store9from storm.locals import Store
9from testtools.matchers import StartsWith10from testtools.matchers import StartsWith
@@ -112,6 +113,7 @@
112113
113 def test_cancel_build_not_owner(self):114 def test_cancel_build_not_owner(self):
114 """A normal user can't cancel a build."""115 """A normal user can't cancel a build."""
116 self.useFixture(FakeLogger())
115 queue = self.factory.makeSourcePackageRecipeBuild().queueBuild()117 queue = self.factory.makeSourcePackageRecipeBuild().queueBuild()
116 build = queue.specific_build118 build = queue.specific_build
117 transaction.commit()119 transaction.commit()
@@ -195,6 +197,7 @@
195197
196 def test_rescore_build_not_admin(self):198 def test_rescore_build_not_admin(self):
197 """No one but admin can rescore a build."""199 """No one but admin can rescore a build."""
200 self.useFixture(FakeLogger())
198 queue = self.factory.makeSourcePackageRecipeBuild().queueBuild()201 queue = self.factory.makeSourcePackageRecipeBuild().queueBuild()
199 build = queue.specific_build202 build = queue.specific_build
200 transaction.commit()203 transaction.commit()
201204
=== modified file 'lib/lp/registry/browser/tests/test_packaging.py'
--- lib/lp/registry/browser/tests/test_packaging.py 2016-09-09 16:51:36 +0000
+++ lib/lp/registry/browser/tests/test_packaging.py 2017-05-11 14:53:15 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the1# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Browser tests for Packaging actions."""4"""Browser tests for Packaging actions."""
@@ -25,10 +25,7 @@
25 logout,25 logout,
26 TestCaseWithFactory,26 TestCaseWithFactory,
27 )27 )
28from lp.testing.layers import (28from lp.testing.layers import DatabaseFunctionalLayer
29 DatabaseFunctionalLayer,
30 PageTestLayer,
31 )
32from lp.testing.pages import setupBrowser29from lp.testing.pages import setupBrowser
33from lp.testing.views import create_initialized_view30from lp.testing.views import create_initialized_view
3431
@@ -152,7 +149,7 @@
152class TestBrowserDeletePackaging(TestCaseWithFactory):149class TestBrowserDeletePackaging(TestCaseWithFactory):
153 """Browser tests for deletion of Packaging objects."""150 """Browser tests for deletion of Packaging objects."""
154151
155 layer = PageTestLayer152 layer = DatabaseFunctionalLayer
156153
157 def setUp(self):154 def setUp(self):
158 super(TestBrowserDeletePackaging, self).setUp()155 super(TestBrowserDeletePackaging, self).setUp()
159156
=== modified file 'lib/lp/registry/browser/tests/test_person.py'
--- lib/lp/registry/browser/tests/test_person.py 2017-04-22 13:13:22 +0000
+++ lib/lp/registry/browser/tests/test_person.py 2017-05-11 14:53:15 +0000
@@ -8,6 +8,7 @@
8import re8import re
9from textwrap import dedent9from textwrap import dedent
1010
11from fixtures import FakeLogger
11import soupmatchers12import soupmatchers
12from storm.store import Store13from storm.store import Store
13from testtools.matchers import (14from testtools.matchers import (
@@ -44,7 +45,7 @@
44from lp.services.config import config45from lp.services.config import config
45from lp.services.identity.interfaces.account import AccountStatus46from lp.services.identity.interfaces.account import AccountStatus
46from lp.services.identity.interfaces.emailaddress import IEmailAddressSet47from lp.services.identity.interfaces.emailaddress import IEmailAddressSet
47from lp.services.log.logger import FakeLogger48from lp.services.log.logger import DevNullLogger
48from lp.services.mail import stub49from lp.services.mail import stub
49from lp.services.propertycache import clear_property_cache50from lp.services.propertycache import clear_property_cache
50from lp.services.verification.interfaces.authtoken import LoginTokenType51from lp.services.verification.interfaces.authtoken import LoginTokenType
@@ -747,6 +748,7 @@
747748
748 def test_team_editemails_not_found(self):749 def test_team_editemails_not_found(self):
749 """Teams should not have a +editemails page."""750 """Teams should not have a +editemails page."""
751 self.useFixture(FakeLogger())
750 team = self.factory.makeTeam(owner=self.person, members=[self.person])752 team = self.factory.makeTeam(owner=self.person, members=[self.person])
751 url = '%s/+editemails' % canonical_url(team)753 url = '%s/+editemails' % canonical_url(team)
752 browser = setupBrowserForUser(user=self.person)754 browser = setupBrowserForUser(user=self.person)
@@ -754,6 +756,7 @@
754756
755 def test_team_editmailinglists_not_found(self):757 def test_team_editmailinglists_not_found(self):
756 """Teams should not have a +editmailinglists page."""758 """Teams should not have a +editmailinglists page."""
759 self.useFixture(FakeLogger())
757 team = self.factory.makeTeam(owner=self.person, members=[self.person])760 team = self.factory.makeTeam(owner=self.person, members=[self.person])
758 url = '%s/+editmailinglists' % canonical_url(team)761 url = '%s/+editmailinglists' % canonical_url(team)
759 browser = setupBrowserForUser(user=self.person)762 browser = setupBrowserForUser(user=self.person)
@@ -998,7 +1001,7 @@
998 spphs.append(spph)1001 spphs.append(spph)
999 # Update the releases cache table.1002 # Update the releases cache table.
1000 switch_dbuser('garbo_frequently')1003 switch_dbuser('garbo_frequently')
1001 job = PopulateLatestPersonSourcePackageReleaseCache(FakeLogger())1004 job = PopulateLatestPersonSourcePackageReleaseCache(DevNullLogger())
1002 while not job.isDone():1005 while not job.isDone():
1003 job(chunk_size=100)1006 job(chunk_size=100)
1004 switch_dbuser('launchpad')1007 switch_dbuser('launchpad')
@@ -1258,7 +1261,7 @@
1258 self.build.updateStatus(BuildStatus.FAILEDTOBUILD)1261 self.build.updateStatus(BuildStatus.FAILEDTOBUILD)
1259 # Update the releases cache table.1262 # Update the releases cache table.
1260 switch_dbuser('garbo_frequently')1263 switch_dbuser('garbo_frequently')
1261 job = PopulateLatestPersonSourcePackageReleaseCache(FakeLogger())1264 job = PopulateLatestPersonSourcePackageReleaseCache(DevNullLogger())
1262 while not job.isDone():1265 while not job.isDone():
1263 job(chunk_size=100)1266 job(chunk_size=100)
1264 switch_dbuser('launchpad')1267 switch_dbuser('launchpad')
12651268
=== modified file 'lib/lp/registry/browser/tests/test_reassign_team_view.py'
--- lib/lp/registry/browser/tests/test_reassign_team_view.py 2012-12-10 13:43:47 +0000
+++ lib/lp/registry/browser/tests/test_reassign_team_view.py 2017-05-11 14:53:15 +0000
@@ -1,10 +1,11 @@
1# Copyright 2011 Canonical Ltd. This software is licensed under the1# Copyright 2011-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for TeamReassignmentView view code."""4"""Tests for TeamReassignmentView view code."""
55
6__metaclass__ = type6__metaclass__ = type
77
8from fixtures import FakeLogger
8from zope.component import getUtility9from zope.component import getUtility
9from zope.security.interfaces import Unauthorized10from zope.security.interfaces import Unauthorized
10from zope.security.proxy import removeSecurityProxy11from zope.security.proxy import removeSecurityProxy
@@ -31,6 +32,7 @@
3132
32 def test_non_owner_unauthorised(self):33 def test_non_owner_unauthorised(self):
33 # Only team owners can reassign team ownership.34 # Only team owners can reassign team ownership.
35 self.useFixture(FakeLogger())
34 team = self.factory.makeTeam()36 team = self.factory.makeTeam()
35 any_person = self.factory.makePerson()37 any_person = self.factory.makePerson()
36 reassign_url = canonical_url(team, view_name='+reassign')38 reassign_url = canonical_url(team, view_name='+reassign')
3739
=== modified file 'lib/lp/services/features/browser/tests/test_feature_editor.py'
--- lib/lp/services/features/browser/tests/test_feature_editor.py 2014-02-27 05:26:26 +0000
+++ lib/lp/services/features/browser/tests/test_feature_editor.py 2017-05-11 14:53:15 +0000
@@ -1,4 +1,4 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the1# Copyright 2010-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for feature rule editor"""4"""Tests for feature rule editor"""
@@ -7,6 +7,7 @@
77
8from textwrap import dedent8from textwrap import dedent
99
10from fixtures import FakeLogger
10from testtools.matchers import Equals11from testtools.matchers import Equals
11from zope.component import getUtility12from zope.component import getUtility
12from zope.security.interfaces import Unauthorized13from zope.security.interfaces import Unauthorized
@@ -39,6 +40,10 @@
3940
40 layer = DatabaseFunctionalLayer41 layer = DatabaseFunctionalLayer
4142
43 def setUp(self):
44 super(TestFeatureControlPage, self).setUp()
45 self.useFixture(FakeLogger())
46
42 def getUserBrowserAsTeamMember(self, teams):47 def getUserBrowserAsTeamMember(self, teams):
43 """Make a TestBrowser authenticated as a team member.48 """Make a TestBrowser authenticated as a team member.
4449
4550
=== modified file 'lib/lp/services/webapp/tests/test_publication.py'
--- lib/lp/services/webapp/tests/test_publication.py 2016-01-26 15:14:01 +0000
+++ lib/lp/services/webapp/tests/test_publication.py 2017-05-11 14:53:15 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the1# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests publication.py"""4"""Tests publication.py"""
@@ -13,6 +13,7 @@
13 OAuthSignatureMethod_PLAINTEXT,13 OAuthSignatureMethod_PLAINTEXT,
14 OAuthToken,14 OAuthToken,
15 )15 )
16from fixtures import FakeLogger
16from storm.database import (17from storm.database import (
17 STATE_DISCONNECTED,18 STATE_DISCONNECTED,
18 STATE_RECONNECT,19 STATE_RECONNECT,
@@ -282,6 +283,7 @@
282 def test_not_found(self):283 def test_not_found(self):
283 # No oopses are reported when accessing the referer while rendering284 # No oopses are reported when accessing the referer while rendering
284 # the page.285 # the page.
286 self.useFixture(FakeLogger())
285 browser = self.getUserBrowser()287 browser = self.getUserBrowser()
286 browser.addHeader('Referer', '/whut\xe7foo')288 browser.addHeader('Referer', '/whut\xe7foo')
287 self.assertRaises(289 self.assertRaises(
@@ -298,6 +300,7 @@
298 def test_non_ascii_url(self):300 def test_non_ascii_url(self):
299 # No oopses are reported when accessing the URL while rendering the301 # No oopses are reported when accessing the URL while rendering the
300 # page.302 # page.
303 self.useFixture(FakeLogger())
301 browser = self.getUserBrowser()304 browser = self.getUserBrowser()
302 self.assertRaises(305 self.assertRaises(
303 NotFound,306 NotFound,
304307
=== modified file 'lib/lp/translations/browser/tests/test_distribution_views.py'
--- lib/lp/translations/browser/tests/test_distribution_views.py 2012-01-01 02:58:52 +0000
+++ lib/lp/translations/browser/tests/test_distribution_views.py 2017-05-11 14:53:15 +0000
@@ -1,10 +1,11 @@
1# Copyright 2011 Canonical Ltd. This software is licensed under the1# Copyright 2011-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for the translations views on a distroseries."""4"""Tests for the translations views on a distroseries."""
55
6__metaclass__ = type6__metaclass__ = type
77
8from fixtures import FakeLogger
8from zope.security.interfaces import Unauthorized9from zope.security.interfaces import Unauthorized
910
10from lp.services.webapp import canonical_url11from lp.services.webapp import canonical_url
@@ -38,6 +39,7 @@
38 def test_unprivileged_users(self):39 def test_unprivileged_users(self):
39 # Unprivileged users cannot access distribution translation settings40 # Unprivileged users cannot access distribution translation settings
40 # page Distribution:+configure-translations.41 # page Distribution:+configure-translations.
42 self.useFixture(FakeLogger())
41 unprivileged = self.factory.makePerson()43 unprivileged = self.factory.makePerson()
42 distribution = self.factory.makeDistribution()44 distribution = self.factory.makeDistribution()
43 browser = self.getUserBrowser(user=unprivileged)45 browser = self.getUserBrowser(user=unprivileged)
4446
=== modified file 'lib/lp/translations/scripts/tests/test_remove_translations.py'
--- lib/lp/translations/scripts/tests/test_remove_translations.py 2014-12-08 23:42:47 +0000
+++ lib/lp/translations/scripts/tests/test_remove_translations.py 2017-05-11 14:53:15 +0000
@@ -1,6 +1,6 @@
1#! /usr/bin/python1#! /usr/bin/python
2#2#
3# Copyright 2009 Canonical Ltd. This software is licensed under the3# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
4# GNU Affero General Public License version 3 (see the file LICENSE).4# GNU Affero General Public License version 3 (see the file LICENSE).
55
6"""Test `remove_translations` and the `RemoveTranslations` script."""6"""Test `remove_translations` and the `RemoveTranslations` script."""
@@ -21,6 +21,7 @@
21from zope.testing.loghandler import Handler21from zope.testing.loghandler import Handler
2222
23from lp.registry.interfaces.person import IPersonSet23from lp.registry.interfaces.person import IPersonSet
24from lp.services.log.logger import DevNullLogger
24from lp.services.scripts.base import LaunchpadScriptFailure25from lp.services.scripts.base import LaunchpadScriptFailure
25from lp.testing import (26from lp.testing import (
26 TestCase,27 TestCase,
@@ -46,7 +47,8 @@
46 """Create a `RemoveTranslations` script with given options."""47 """Create a `RemoveTranslations` script with given options."""
47 if isinstance(args, basestring):48 if isinstance(args, basestring):
48 args = [args]49 args = [args]
49 script = RemoveTranslations('remove-translations-test', test_args=args)50 script = RemoveTranslations(
51 'remove-translations-test', test_args=args, logger=DevNullLogger())
50 return script52 return script
5153
5254
5355
=== modified file 'lib/lp/translations/tests/test_autoapproval.py'
--- lib/lp/translations/tests/test_autoapproval.py 2013-06-20 05:50:00 +0000
+++ lib/lp/translations/tests/test_autoapproval.py 2017-05-11 14:53:15 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2011 Canonical Ltd. This software is licensed under the1# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Unit tests for translation import queue auto-approval.4"""Unit tests for translation import queue auto-approval.
@@ -14,6 +14,7 @@
14 timedelta,14 timedelta,
15 )15 )
1616
17from fixtures import FakeLogger
17from pytz import UTC18from pytz import UTC
18from zope.component import getUtility19from zope.component import getUtility
19from zope.security.proxy import removeSecurityProxy20from zope.security.proxy import removeSecurityProxy
@@ -308,6 +309,7 @@
308309
309 def setUp(self):310 def setUp(self):
310 super(TestTemplateGuess, self).setUp()311 super(TestTemplateGuess, self).setUp()
312 self.useFixture(FakeLogger())
311 self.templateset = POTemplateSet()313 self.templateset = POTemplateSet()
312314
313 def _setUpProduct(self):315 def _setUpProduct(self):