← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~twom/launchpad:fix-oops-on-oci-recipe-edit into launchpad:master

 

Tom Wardill has proposed merging ~twom/launchpad:fix-oops-on-oci-recipe-edit into launchpad:master.

Commit message:
Remove push_rules from edit schema and field_names

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~twom/launchpad/+git/launchpad/+merge/388728

Modify test to include an OCIPushRule, then remove the push_rule from field names and schema for editing.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~twom/launchpad:fix-oops-on-oci-recipe-edit into launchpad:master.
diff --git a/lib/lp/oci/browser/ocirecipe.py b/lib/lp/oci/browser/ocirecipe.py
index e18d990..7c463d5 100644
--- a/lib/lp/oci/browser/ocirecipe.py
+++ b/lib/lp/oci/browser/ocirecipe.py
@@ -500,7 +500,6 @@ class IOCIRecipeEditSchema(Interface):
         "build_daily",
         "require_virtualized",
         "allow_internet",
-        "push_rules",
         ])
 
 
@@ -632,7 +631,6 @@ class OCIRecipeEditView(BaseOCIRecipeEditView, EnableProcessorsMixin):
         "git_ref",
         "build_file",
         "build_daily",
-        "push_rules",
         )
     custom_widget_git_ref = GitRefWidget
 
diff --git a/lib/lp/oci/browser/tests/test_ocirecipe.py b/lib/lp/oci/browser/tests/test_ocirecipe.py
index f85df0f..648096d 100644
--- a/lib/lp/oci/browser/tests/test_ocirecipe.py
+++ b/lib/lp/oci/browser/tests/test_ocirecipe.py
@@ -324,7 +324,7 @@ class TestOCIRecipeAdminView(BaseTestOCIRecipeView):
             recipe, "date_last_modified", UTC_NOW)
 
 
-class TestOCIRecipeEditView(BaseTestOCIRecipeView):
+class TestOCIRecipeEditView(OCIConfigHelperMixin, BaseTestOCIRecipeView):
 
     def setUp(self):
         super(TestOCIRecipeEditView, self).setUp()
@@ -335,6 +335,7 @@ class TestOCIRecipeEditView(BaseTestOCIRecipeView):
             "oci.build_series.%s" % self.distribution.name:
                 self.distroseries.name,
             }))
+        self.setConfig()
 
     def setUpDistroSeries(self):
         """Set up self.distroseries with some available processors."""
@@ -368,6 +369,7 @@ class TestOCIRecipeEditView(BaseTestOCIRecipeView):
         self.factory.makeTeam(
             name="new-team", displayname="New Team", members=[self.person])
         [new_git_ref] = self.factory.makeGitRefs()
+        self.factory.makeOCIPushRule(recipe=recipe)
 
         browser = self.getViewBrowser(recipe, user=self.person)
         browser.getLink("Edit OCI recipe").click()