← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rharding/launchpad/fix_buildbot_tests into lp:launchpad

 

Richard Harding has proposed merging lp:~rharding/launchpad/fix_buildbot_tests into lp:launchpad.

Commit message:
Correct broken tests from adding private product enabling.

Requested reviews:
  Richard Harding (rharding)

For more details, see:
https://code.launchpad.net/~rharding/launchpad/fix_buildbot_tests/+merge/128941

Fixes tests that didn't come up in ec2 land. 
-- 
https://code.launchpad.net/~rharding/launchpad/fix_buildbot_tests/+merge/128941
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/registry/browser/tests/test_product.py'
--- lib/lp/registry/browser/tests/test_product.py	2012-10-09 15:33:56 +0000
+++ lib/lp/registry/browser/tests/test_product.py	2012-10-10 14:00:38 +0000
@@ -440,7 +440,7 @@
     def setUp(self):
         super(TestProductEditView, self).setUp()
 
-    def _make_product_edit_form(self, proprietary=False):
+    def _make_product_edit_form(self, product, proprietary=False):
         """Return form data for product edit.
 
         :param product: Factory product to base the form data base of.
@@ -456,10 +456,10 @@
 
         return {
             'field.actions.change': 'Change',
-            'field.name': self.product.name,
-            'field.displayname': self.product.displayname,
-            'field.title': self.product.title,
-            'field.summary': self.product.summary,
+            'field.name': product.name,
+            'field.displayname': product.displayname,
+            'field.title': product.title,
+            'field.summary': product.summary,
             'field.information_type': information_type,
             'field.licenses': licenses,
             'field.license_info': license_info,
@@ -469,7 +469,7 @@
         product = self.factory.makeProduct(name='fnord')
         with FeatureFixture({u'disclosure.private_projects.enabled': u'on'}):
             login_person(product.owner)
-            form = self._make_product_edit_form(proprietary=True)
+            form = self._make_product_edit_form(product, proprietary=True)
             view = create_initialized_view(product, '+edit', form=form)
             self.assertEqual(0, len(view.errors))
 
@@ -490,7 +490,7 @@
         )
         with FeatureFixture({u'disclosure.private_projects.enabled': u'on'}):
             login_person(owner)
-            form = self._make_product_edit_form()
+            form = self._make_product_edit_form(product)
             view = create_initialized_view(product, '+edit', form=form)
             self.assertEqual(0, len(view.errors))
 

=== modified file 'lib/lp/scripts/tests/test_garbo.py'
--- lib/lp/scripts/tests/test_garbo.py	2012-10-08 10:07:11 +0000
+++ lib/lp/scripts/tests/test_garbo.py	2012-10-10 14:00:38 +0000
@@ -1064,18 +1064,18 @@
         # Set all existing projects to something other than None or 1.
         store = IMasterStore(Product)
         store.execute(Update(
-            {Product.information_type: 2}))
+            {Product._information_type: 2}))
         store.flush()
         # Make a new product without an information_type.
         product = self.factory.makeProduct()
         store.execute(Update(
-            {Product.information_type: None}, Product.id == product.id))
+            {Product._information_type: None}, Product.id == product.id))
         store.flush()
         self.assertEqual(1, store.find(Product,
-            Product.information_type == None).count())
+            Product._information_type == None).count())
         self.runDaily()
         self.assertEqual(0, store.find(Product,
-            Product.information_type == None).count())
+            Product._information_type == None).count())
 
 
 class TestGarboTasks(TestCaseWithFactory):


Follow ups