Commits

Olemis Lang  committed 4be26f6

BH Multiproduct #355 : Rewrite test cases for editing ticket comments

  • Participants
  • Parent commits 44231c1
  • Branches t355_trac_test_suite

Comments (0)

Files changed (2)

+t355/t355_r1444754_trac_test_ticket_comments.diff
 #t288/t288_r1438538_sql_translate_global_env.diff
 #t288/t288_r1438538_sql_translate_global_env_pending.diff
 #t288/t288_r1441419_sql_translate_cursor.diff
 #t355/t355_r1437383_pkgresources_discovery.diff
 #t355/t355_r1437383_trac_test_perm.diff
 #t355/t355_r1437383_trac_test_ticket_api.diff
-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_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

File t355/t355_r1444754_trac_test_ticket_comments.diff

+# HG changeset patch
+# Parent 8469e855776f7019d7ccd671e5d0c6691d8450ae
+BH Multiproduct #355 : Rewrite Trac test cases for ticket comments to run them against product environments
+
+diff -r 8469e855776f bloodhound_multiproduct/tests/ticket/model.py
+--- a/bloodhound_multiproduct/tests/ticket/model.py	Mon Feb 11 13:05:18 2013 +0000
++++ b/bloodhound_multiproduct/tests/ticket/model.py	Tue Feb 12 22:32:04 2013 -0500
+@@ -47,6 +47,30 @@
+         self.global_env.reset_db()
+         self.env = self.global_env = None
+ 
++class ProductTicketCommentEditTestCase(TicketCommentEditTestCase,
++        MultiproductTestCase):
++
++    @property
++    def env(self):
++        env = getattr(self, '_env', None)
++        if env is None:
++            self.global_env = self._setup_test_env()
++            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._env = env = ProductEnvironment(
++                    self.global_env, self.default_product)
++            self._load_default_data(env)
++        return env
++
++    @env.setter
++    def env(self, value):
++        pass
++
++    def tearDown(self):
++        self.global_env.reset_db()
++        self._env = self.global_env = None
++
+ class ProductEnumTestCase(EnumTestCase, MultiproductTestCase):
+     def setUp(self):
+         self._mp_setup()
+@@ -116,7 +140,7 @@
+ def test_suite():
+     suite = unittest.TestSuite()
+     suite.addTest(unittest.makeSuite(ProductTicketTestCase, 'test'))
+-#    suite.addTest(unittest.makeSuite(ProductTicketCommentEditTestCase, 'test'))
++    suite.addTest(unittest.makeSuite(ProductTicketCommentEditTestCase, 'test'))
+ #    suite.addTest(unittest.makeSuite(ProductTicketCommentDeleteTestCase, 'test'))
+     suite.addTest(unittest.makeSuite(ProductEnumTestCase, 'test'))
+     suite.addTest(unittest.makeSuite(ProductMilestoneTestCase, 'test'))