Olemis Lang avatar Olemis Lang committed 057e911

BH Multiproduct #355 : Checking for custom fields isolation across product boundaries (against r1442575) ... [ok]

Comments (0)

Files changed (2)

t288/t288_r1438538_sql_translate_global_env_pending.diff

 # HG changeset patch
-# Parent 01f625dcd92ab5f3d4814adf774d6026d153add0
+# Parent 7433833ac94bdfbcf541b3d6536bc15984b3fbd2
 BH Multiproduct #288 : SQL translate global environment (pending)
 
-diff -r 01f625dcd92a bloodhound_multiproduct/multiproduct/env.py
---- a/bloodhound_multiproduct/multiproduct/env.py	Thu Jan 31 14:41:22 2013 +0000
-+++ b/bloodhound_multiproduct/multiproduct/env.py	Thu Jan 31 12:24:15 2013 -0500
-@@ -90,14 +90,6 @@
-         super(EnvironmentStub, self).__init__(default_data=default_data,
-                                               enable=enable, disable=disable,
-                                               path=path, destroying=destroying)
--        # Apply multi product upgrades. This is required as the database proxy (translator)
--        # is installed in any case, we want it to see multi-product enabled database
--        # schema...
--        mpsystem = MultiProductSystem(self)
+diff -r 7433833ac94b bloodhound_multiproduct/multiproduct/env.py
+--- a/bloodhound_multiproduct/multiproduct/env.py	Tue Feb 05 14:22:55 2013 +0000
++++ b/bloodhound_multiproduct/multiproduct/env.py	Tue Feb 05 12:21:32 2013 -0500
+@@ -111,11 +111,11 @@
+         # Apply multi product upgrades. This is required as the database proxy (translator)
+         # is installed in any case, we want it to see multi-product enabled database
+         # schema...
+-        self.mpsystem = MultiProductSystem(self)
 -        try:
--            mpsystem.upgrade_environment()
+-            self.mpsystem.upgrade_environment()
 -        except OperationalError:
 -            pass
++#        self.mpsystem = MultiProductSystem(self)
++#        try:
++#            self.mpsystem.upgrade_environment()
++#        except OperationalError:
++#            pass
  
- # replace trac.test.EnvironmentStub
- trac.test.EnvironmentStub = EnvironmentStub
+     def reset_db(self, default_data=None):
+         from multiproduct.api import DB_VERSION

t355/t355_r1437383_trac_test_ticket_api.diff

 # HG changeset patch
-# Parent b4eb93330ef507b1561c97b8eb2f69d3fd9364c3
+# Parent 271f5b2eb7a198fb9fb0bcc2435c0b8fe8eccf0a
 BH Multiproduct #355 : Rewrite Trac test cases for ticket API so as to run them against product environments
 
-diff -r b4eb93330ef5 bloodhound_multiproduct/tests/ticket/__init__.py
+diff -r 271f5b2eb7a1 bloodhound_multiproduct/tests/ticket/__init__.py
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/bloodhound_multiproduct/tests/ticket/__init__.py	Tue Feb 05 12:06:08 2013 -0500
++++ b/bloodhound_multiproduct/tests/ticket/__init__.py	Tue Feb 05 12:31:12 2013 -0500
 @@ -0,0 +1,20 @@
 +
 +#  Licensed to the Apache Software Foundation (ASF) under one
 +
 +"""Tests for Apache(TM) Bloodhound's tickets in product environments"""
 +
-diff -r b4eb93330ef5 bloodhound_multiproduct/tests/ticket/api.py
+diff -r 271f5b2eb7a1 bloodhound_multiproduct/tests/ticket/api.py
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/bloodhound_multiproduct/tests/ticket/api.py	Tue Feb 05 12:06:08 2013 -0500
-@@ -0,0 +1,70 @@
++++ b/bloodhound_multiproduct/tests/ticket/api.py	Tue Feb 05 12:31:12 2013 -0500
+@@ -0,0 +1,92 @@
 +
 +#  Licensed to the Apache Software Foundation (ASF) under one
 +#  or more contributor license agreements.  See the NOTICE file
 +    def tearDown(self):
 +        self.global_env.reset_db()
 +
++    def test_custom_field_isolation(self):
++        self.env.config.set('ticket-custom', 'test', 'select')
++        self.env.config.set('ticket-custom', 'test.label', 'Test')
++        self.env.config.set('ticket-custom', 'test.value', '1')
++        self.env.config.set('ticket-custom', 'test.options', 'option1|option2')
++
++        self.global_env.config.set('ticket-custom', 'test', 'text')
++        self.global_env.config.set('ticket-custom', 'test.label', 'Test')
++        self.global_env.config.set('ticket-custom', 'test.value', 'Foo bar')
++        self.global_env.config.set('ticket-custom', 'test.format', 'wiki')
++
++        product_fields = TicketSystem(self.env).get_custom_fields()
++        global_fields = TicketSystem(self.global_env).get_custom_fields()
++
++        self.assertEqual({'name': 'test', 'type': 'select', 'label': 'Test',
++                          'value': '1', 'options': ['option1', 'option2'],
++                          'order': 0},
++                         product_fields[0])
++        self.assertEqual({'name': 'test', 'type': 'text', 'label': 'Test',
++                          'value': 'Foo bar', 'order': 0, 'format': 'wiki'},
++                         global_fields[0])
++
 +    def test_available_actions_isolation(self):
 +        # Grant TICKET_CREATE in product environment ...
 +        self.perm.grant_permission('anonymous', 'TICKET_CREATE')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.