Merge ~pappacena/launchpad:oci-create-test-toggle-fix into launchpad:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: 558bf3d5063865cde0dd6e745cd93d2bfd13353c
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/launchpad:oci-create-test-toggle-fix
Merge into: launchpad:master
Diff against target: 73 lines (+17/-5)
3 files modified
lib/lp/services/webhooks/tests/test_browser.py (+5/-1)
lib/lp/services/webhooks/tests/test_model.py (+6/-2)
lib/lp/services/webhooks/tests/test_webservice.py (+6/-2)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+381595@code.launchpad.net

Commit message

Setting on some test cases the feature toggle that allows us to create OCIRecipe, to fix broken build.

To post a comment you must log in.
cf55d9a... by Thiago F. Pappacena

Formatting imports

558bf3d... by Thiago F. Pappacena

Adding feature flag to allow OCI recipe creation on test

Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/services/webhooks/tests/test_browser.py b/lib/lp/services/webhooks/tests/test_browser.py
2index 95ff526..6157d0c 100644
3--- a/lib/lp/services/webhooks/tests/test_browser.py
4+++ b/lib/lp/services/webhooks/tests/test_browser.py
5@@ -16,7 +16,10 @@ from testtools.matchers import (
6 import transaction
7 from zope.component import getUtility
8
9-from lp.oci.interfaces.ocirecipe import OCI_RECIPE_WEBHOOKS_FEATURE_FLAG
10+from lp.oci.interfaces.ocirecipe import (
11+ OCI_RECIPE_ALLOW_CREATE,
12+ OCI_RECIPE_WEBHOOKS_FEATURE_FLAG,
13+ )
14 from lp.services.features.testing import FeatureFixture
15 from lp.services.webapp.interfaces import IPlacelessAuthUtility
16 from lp.services.webapp.publisher import canonical_url
17@@ -146,6 +149,7 @@ class OCIRecipeTestHelpers:
18 self.useFixture(FeatureFixture({
19 'webhooks.new.enabled': 'true',
20 OCI_RECIPE_WEBHOOKS_FEATURE_FLAG: 'on',
21+ OCI_RECIPE_ALLOW_CREATE: 'on'
22 }))
23 owner = self.factory.makePerson()
24 return self.factory.makeOCIRecipe(registrant=owner, owner=owner)
25diff --git a/lib/lp/services/webhooks/tests/test_model.py b/lib/lp/services/webhooks/tests/test_model.py
26index e8810f2..08b72fc 100644
27--- a/lib/lp/services/webhooks/tests/test_model.py
28+++ b/lib/lp/services/webhooks/tests/test_model.py
29@@ -13,7 +13,10 @@ from zope.security.checker import getChecker
30 from zope.security.proxy import removeSecurityProxy
31
32 from lp.app.enums import InformationType
33-from lp.oci.interfaces.ocirecipe import OCI_RECIPE_WEBHOOKS_FEATURE_FLAG
34+from lp.oci.interfaces.ocirecipe import (
35+ OCI_RECIPE_ALLOW_CREATE,
36+ OCI_RECIPE_WEBHOOKS_FEATURE_FLAG,
37+ )
38 from lp.registry.enums import BranchSharingPolicy
39 from lp.services.database.interfaces import IStore
40 from lp.services.features.testing import FeatureFixture
41@@ -425,6 +428,7 @@ class TestWebhookSetOCIRecipe(TestWebhookSetBase, TestCaseWithFactory):
42 if owner is None:
43 owner = self.factory.makePerson()
44
45- with FeatureFixture({OCI_RECIPE_WEBHOOKS_FEATURE_FLAG: "on"}):
46+ with FeatureFixture({OCI_RECIPE_WEBHOOKS_FEATURE_FLAG: "on",
47+ OCI_RECIPE_ALLOW_CREATE: 'on'}):
48 return self.factory.makeOCIRecipe(
49 registrant=owner, owner=owner, **kwargs)
50diff --git a/lib/lp/services/webhooks/tests/test_webservice.py b/lib/lp/services/webhooks/tests/test_webservice.py
51index dafc6d0..ba8bb91 100644
52--- a/lib/lp/services/webhooks/tests/test_webservice.py
53+++ b/lib/lp/services/webhooks/tests/test_webservice.py
54@@ -21,7 +21,10 @@ from testtools.matchers import (
55 )
56 from zope.security.proxy import removeSecurityProxy
57
58-from lp.oci.interfaces.ocirecipe import OCI_RECIPE_WEBHOOKS_FEATURE_FLAG
59+from lp.oci.interfaces.ocirecipe import (
60+ OCI_RECIPE_ALLOW_CREATE,
61+ OCI_RECIPE_WEBHOOKS_FEATURE_FLAG,
62+ )
63 from lp.services.features.testing import FeatureFixture
64 from lp.services.webapp.interfaces import OAuthPermission
65 from lp.soyuz.interfaces.livefs import (
66@@ -403,5 +406,6 @@ class TestWebhookTargetOCIRecipe(TestWebhookTargetBase, TestCaseWithFactory):
67
68 def makeTarget(self):
69 owner = self.factory.makePerson()
70- with FeatureFixture({OCI_RECIPE_WEBHOOKS_FEATURE_FLAG: "on"}):
71+ with FeatureFixture({OCI_RECIPE_WEBHOOKS_FEATURE_FLAG: "on",
72+ OCI_RECIPE_ALLOW_CREATE: 'on'}):
73 return self.factory.makeOCIRecipe(registrant=owner, owner=owner)