← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:fix-remove-xpi-importer into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:fix-remove-xpi-importer into launchpad:master.

Commit message:
Fix test failures due to removing XPI imports

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/381052
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:fix-remove-xpi-importer into launchpad:master.
diff --git a/lib/lp/code/model/tests/test_branchjob.py b/lib/lp/code/model/tests/test_branchjob.py
index 0c4a893..6078099 100644
--- a/lib/lp/code/model/tests/test_branchjob.py
+++ b/lib/lp/code/model/tests/test_branchjob.py
@@ -1062,17 +1062,6 @@ class TestRosettaUploadJob(TestCaseWithFactory):
         self.assertEqual([(po_path, po_content)],
                          job.translation_files_changed)
 
-    def test_upload_xpi_template(self):
-        # XPI templates are indentified by a special name. They are imported
-        # like POT files.
-        pot_name = "en-US.xpi"
-        entries = self._runJobWithFiles(
-            TranslationsBranchImportMode.IMPORT_TEMPLATES,
-            ((pot_name,), ('eo.xpi',), ('README',)))
-        self.assertEqual(len(entries), 1)
-        entry = entries[0]
-        self.assertEqual(pot_name, entry.path)
-
     def test_upload_empty_pot(self):
         # An empty POT cannot be uploaded, if if the product series is
         # configured for template import.
diff --git a/lib/lp/testing/fixture.py b/lib/lp/testing/fixture.py
index 374c1a6..ee9309e 100644
--- a/lib/lp/testing/fixture.py
+++ b/lib/lp/testing/fixture.py
@@ -237,12 +237,12 @@ class ZopeUtilityFixture(Fixture):
         gsm = getGlobalSiteManager()
         original = gsm.queryUtility(self.intf, self.name)
         gsm.registerUtility(self.component, self.intf, self.name)
-        self.addCleanup(
-            gsm.unregisterUtility,
-            self.component, self.intf, self.name)
         if original is not None:
             self.addCleanup(
                 gsm.registerUtility, original, self.intf, self.name)
+        self.addCleanup(
+            gsm.unregisterUtility,
+            self.component, self.intf, self.name)
 
 
 class CaptureOops(Fixture):