Commits

Olemis Lang committed 372c4b8

BH Multiproduct #355 : Rewrite test cases for ticket enum fields , component and version ... [ok]

Comments (0)

Files changed (2)

 t355/t355_r1442601_trac_test_env_cmp_enabled.diff
 t355/t355_r1442601_trac_test_ticket_conversion.diff
 t355/t355_r1442601_trac_test_ticket_model.diff
+t355/t355_r1442601_trac_test_ticket_enum.diff
 #t355/t355_r1442601_trac_test_ticket_batch.diff

t355/t355_r1442601_trac_test_ticket_enum.diff

+# HG changeset patch
+# Parent 1b1ca5bc39e188d2d1e83ec38236c1080d8c3b72
+BH Multiproduct #355 : Rewrite Trac test cases for ticket enum models (including milestone, component and version) so as to run them against product environments
+
+diff -r 1b1ca5bc39e1 bloodhound_multiproduct/tests/ticket/model.py
+--- a/bloodhound_multiproduct/tests/ticket/model.py	Sat Feb 09 00:41:52 2013 -0500
++++ b/bloodhound_multiproduct/tests/ticket/model.py	Sat Feb 09 15:16:04 2013 -0500
+@@ -30,11 +30,8 @@
+ class ProductTicketTestCase(TicketTestCase, MultiproductTestCase):
+ 
+     def setUp(self):
+-        self.global_env = self._setup_test_env(create_folder=False, 
+-                default_data=True)
+-        self._upgrade_mp(self.global_env)
+-        self._setup_test_log(self.global_env)
+-        self._load_product_from_data(self.global_env, self.default_product)
++        self._mp_setup()
++        self.global_env = self.env
+         self.env = ProductEnvironment(self.global_env, self.default_product)
+         self._load_default_data(self.env)
+ 
+@@ -45,16 +42,46 @@
+     def tearDown(self):
+         self.global_env.reset_db()
+ 
++class ProductEnumTestCase(EnumTestCase, MultiproductTestCase):
++    def setUp(self):
++        self._mp_setup()
++        self.global_env = self.env
++        self.env = ProductEnvironment(self.global_env, self.default_product)
++        self._load_default_data(self.env)
++
++    def tearDown(self):
++        self.global_env.reset_db()
++
++class ProductComponentTestCase(ComponentTestCase, MultiproductTestCase):
++    def setUp(self):
++        self._mp_setup()
++        self.global_env = self.env
++        self.env = ProductEnvironment(self.global_env, self.default_product)
++        self._load_default_data(self.env)
++
++    def tearDown(self):
++        self.global_env.reset_db()
++
++class ProductVersionTestCase(VersionTestCase, MultiproductTestCase):
++    def setUp(self):
++        self._mp_setup()
++        self.global_env = self.env
++        self.env = ProductEnvironment(self.global_env, self.default_product)
++        self._load_default_data(self.env)
++
++    def tearDown(self):
++        self.global_env.reset_db()
++
+ 
+ def test_suite():
+     suite = unittest.TestSuite()
+     suite.addTest(unittest.makeSuite(ProductTicketTestCase, 'test'))
+ #    suite.addTest(unittest.makeSuite(ProductTicketCommentEditTestCase, 'test'))
+ #    suite.addTest(unittest.makeSuite(ProductTicketCommentDeleteTestCase, 'test'))
+-#    suite.addTest(unittest.makeSuite(ProductEnumTestCase, 'test'))
++    suite.addTest(unittest.makeSuite(ProductEnumTestCase, 'test'))
+ #    suite.addTest(unittest.makeSuite(ProductMilestoneTestCase, 'test'))
+-#    suite.addTest(unittest.makeSuite(ProductComponentTestCase, 'test'))
+-#    suite.addTest(unittest.makeSuite(ProductVersionTestCase, 'test'))
++    suite.addTest(unittest.makeSuite(ProductComponentTestCase, 'test'))
++    suite.addTest(unittest.makeSuite(ProductVersionTestCase, 'test'))
+     return suite
+ 
+ if __name__ == '__main__':