Merge lp:~cjwatson/launchpad/git-feature-flag into lp:launchpad

Proposed by Colin Watson on 2015-03-05
Status: Merged
Approved by: Colin Watson on 2015-03-05
Approved revision: no longer in the source branch.
Merged at revision: 17380
Proposed branch: lp:~cjwatson/launchpad/git-feature-flag
Merge into: lp:launchpad
Diff against target: 80 lines (+15/-0)
2 files modified
lib/lp/code/browser/tests/test_gitrepository.py (+10/-0)
lib/lp/registry/browser/tests/test_person.py (+5/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/git-feature-flag
Reviewer Review Type Date Requested Status
Colin Watson Approve on 2015-03-05
Review via email: mp+251965@code.launchpad.net

Commit message

Set the code.git.enabled feature flag for TestGitRepositoryView* and TestPersonNavigation.test_traverse_git_repository_* tests.

Description of the change

Set the code.git.enabled feature flag for TestGitRepositoryView* and TestPersonNavigation.test_traverse_git_repository_* tests.

To post a comment you must log in.
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/tests/test_gitrepository.py'
2--- lib/lp/code/browser/tests/test_gitrepository.py 2015-03-04 16:49:42 +0000
3+++ lib/lp/code/browser/tests/test_gitrepository.py 2015-03-05 15:29:12 +0000
4@@ -13,8 +13,10 @@
5
6 from lp.app.enums import InformationType
7 from lp.app.interfaces.services import IService
8+from lp.code.interfaces.gitrepository import GIT_FEATURE_FLAG
9 from lp.registry.interfaces.person import PersonVisibility
10 from lp.services.config import config
11+from lp.services.features.testing import FeatureFixture
12 from lp.services.webapp.publisher import canonical_url
13 from lp.testing import (
14 admin_logged_in,
15@@ -35,6 +37,10 @@
16
17 layer = DatabaseFunctionalLayer
18
19+ def setUp(self):
20+ super(TestGitRepositoryView, self).setUp()
21+ self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
22+
23 def test_anon_url_for_public(self):
24 # Public repositories have an anonymous URL, visible to anyone.
25 repository = self.factory.makeGitRepository()
26@@ -133,6 +139,10 @@
27
28 layer = DatabaseFunctionalLayer
29
30+ def setUp(self):
31+ super(TestGitRepositoryViewPrivateArtifacts, self).setUp()
32+ self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
33+
34 def _getBrowser(self, user=None):
35 if user is None:
36 browser = setupBrowser()
37
38=== modified file 'lib/lp/registry/browser/tests/test_person.py'
39--- lib/lp/registry/browser/tests/test_person.py 2015-03-04 16:57:42 +0000
40+++ lib/lp/registry/browser/tests/test_person.py 2015-03-05 15:29:12 +0000
41@@ -27,6 +27,7 @@
42 from lp.app.interfaces.launchpad import ILaunchpadCelebrities
43 from lp.blueprints.enums import SpecificationImplementationStatus
44 from lp.buildmaster.enums import BuildStatus
45+from lp.code.interfaces.gitrepository import GIT_FEATURE_FLAG
46 from lp.registry.browser.person import PersonView
47 from lp.registry.browser.team import TeamInvitationView
48 from lp.registry.enums import PersonVisibility
49@@ -41,6 +42,7 @@
50 from lp.registry.model.milestone import milestone_sort_key
51 from lp.scripts.garbo import PopulateLatestPersonSourcePackageReleaseCache
52 from lp.services.config import config
53+from lp.services.features.testing import FeatureFixture
54 from lp.services.identity.interfaces.account import AccountStatus
55 from lp.services.identity.interfaces.emailaddress import IEmailAddressSet
56 from lp.services.log.logger import FakeLogger
57@@ -145,6 +147,7 @@
58 self.assertRedirect('/api/1.0' + in_suf, '/api/1.0' + out_suf)
59
60 def test_traverse_git_repository_project(self):
61+ self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
62 project = self.factory.makeProduct()
63 repository = self.factory.makeGitRepository(target=project)
64 url = "/~%s/%s/+git/%s" % (
65@@ -152,6 +155,7 @@
66 self.assertEqual(repository, test_traverse(url)[0])
67
68 def test_traverse_git_repository_package(self):
69+ self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
70 dsp = self.factory.makeDistributionSourcePackage()
71 repository = self.factory.makeGitRepository(target=dsp)
72 url = "/~%s/%s/+source/%s/+git/%s" % (
73@@ -160,6 +164,7 @@
74 self.assertEqual(repository, test_traverse(url)[0])
75
76 def test_traverse_git_repository_personal(self):
77+ self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
78 person = self.factory.makePerson()
79 repository = self.factory.makeGitRepository(
80 owner=person, target=person)