← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/information_type-branch-privacy-trigger into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/information_type-branch-privacy-trigger into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/information_type-branch-privacy-trigger/+merge/105291

Due to the march forward adding information_type to branch, and the fact that it is populated everywhere, we are preparing to set the column to NOT NULL. This branch fixes test failures due to that by making sure that information_type is set.
-- 
https://code.launchpad.net/~stevenk/launchpad/information_type-branch-privacy-trigger/+merge/105291
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/information_type-branch-privacy-trigger into lp:launchpad.
=== modified file 'lib/lp/code/model/tests/test_branch_privacy_triggers.py'
--- lib/lp/code/model/tests/test_branch_privacy_triggers.py	2012-02-21 22:46:28 +0000
+++ lib/lp/code/model/tests/test_branch_privacy_triggers.py	2012-05-10 02:38:18 +0000
@@ -8,6 +8,7 @@
 
 import unittest
 
+from lp.registry.enums import InformationType
 from lp.services.database.sqlbase import cursor
 from lp.testing.dbuser import switch_dbuser
 from lp.testing.layers import LaunchpadZopelessLayer
@@ -29,7 +30,11 @@
         # 6 stacked on 1 at insert time
         cur = cursor()
         for x in range(7):
-            is_private = 'True' if x == 3 else 'False'
+            is_private = 'False'
+            information_type = InformationType.PUBLIC.value
+            if x == 3:
+                is_private = 'True'
+                information_type = InformationType.USERDATA.value
             if x == 4:
                 stacked_on = self.branch_ids[3]
             elif x == 6:
@@ -38,11 +43,12 @@
                 stacked_on = 'NULL'
             cur.execute("""
                 INSERT INTO Branch (
-                    name, private, stacked_on, owner, registrant, branch_type
+                    name, private, information_type, stacked_on, owner,
+                    registrant, branch_type
                     )
-                    VALUES ('branch%d', %s, %s, 1, 1, 1)
+                    VALUES ('branch%d', %s, %s, %s, 1, 1, 1)
                     RETURNING id
-                """ % (x, is_private, stacked_on))
+                """ % (x, is_private, information_type, stacked_on))
             branch_id = cur.fetchone()[0]
             self.branch_ids[x] = branch_id
         self.updateStackedOnForBranch(2, 5)


Follow ups