Commits

Olemis Lang committed 737668c

BH Multiproduct #355 : Initial conversion of ticket query test cases . 'ProductEnvironment.get_read_db' must be reimplemented ... (errors=38)

Comments (0)

Files changed (2)

 #t355/t355_r1442601_trac_test_ticket_model.diff
 #t355/t355_r1442601_trac_test_ticket_enum.diff
 t355/t355_r1444754_trac_test_ticket_batch.diff
+t355/t355_r1444754_trac_test_ticket_query.diff
 
 # Pending patches
-#t355/t355_r1444754_trac_test_ticket_notification.diff
+t355/t355_r1444754_trac_test_ticket_notification.diff

t355/t355_r1444754_trac_test_ticket_query.diff

+# HG changeset patch
+# Parent 01933819d25075749adc1bf2d11ac72a24ca0761
+BH Multiproduct #355 : Rewrite Trac test cases for ticket query module so as to run them against product environments
+
+diff -r 01933819d250 bloodhound_multiproduct/tests/ticket/query.py
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/bloodhound_multiproduct/tests/ticket/query.py	Wed Feb 13 14:37:14 2013 -0500
+@@ -0,0 +1,58 @@
++
++#  Licensed to the Apache Software Foundation (ASF) under one
++#  or more contributor license agreements.  See the NOTICE file
++#  distributed with this work for additional information
++#  regarding copyright ownership.  The ASF licenses this file
++#  to you under the Apache License, Version 2.0 (the
++#  "License"); you may not use this file except in compliance
++#  with the License.  You may obtain a copy of the License at
++#
++#   http://www.apache.org/licenses/LICENSE-2.0
++#
++#  Unless required by applicable law or agreed to in writing,
++#  software distributed under the License is distributed on an
++#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++#  KIND, either express or implied.  See the License for the
++#  specific language governing permissions and limitations
++#  under the License.
++
++"""Tests for Apache(TM) Bloodhound's ticket queries in product environments"""
++
++import unittest
++
++from trac.ticket.tests.query import QueryTestCase
++
++from multiproduct.env import ProductEnvironment
++from tests.env import MultiproductTestCase
++
++class ProductQueryTestCase(QueryTestCase, 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()
++
++
++def test_suite():
++    return unittest.TestSuite([
++            unittest.makeSuite(ProductQueryTestCase,'test'),
++        ])
++
++if __name__ == '__main__':
++    unittest.main(defaultTest='test_suite')
++