Commits

Olemis Lang  committed ea5df1e

BH Multiproduct #355 : Rewrite ticket report test cases for product envs . 'ProductEnvironment.get_read_db' must be reimplemented ... (failures=3, errors=40)

  • Participants
  • Parent commits f663892
  • Branches t355_trac_test_suite

Comments (0)

Files changed (2)

 t355/t355_r1444754_trac_test_ticket_batch.diff
 t355/t355_r1444754_trac_test_ticket_notification.diff
 t355/t355_r1444754_trac_test_ticket_query.diff
+t355/t355_r1444754_trac_test_ticket_report.diff
 
 # Pending patches

File t355/t355_r1444754_trac_test_ticket_report.diff

+# HG changeset patch
+# Parent d470958614cc8ccfbc5d058817254a407ee44978
+BH Multiproduct #355 : Rewrite Trac test cases for ticket report subsystem so as to run them against product environments
+
+diff -r d470958614cc bloodhound_multiproduct/tests/ticket/report.py
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/bloodhound_multiproduct/tests/ticket/report.py	Wed Feb 13 19:24:37 2013 -0500
+@@ -0,0 +1,60 @@
++
++#  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 reports in product environments"""
++
++import unittest
++
++from trac.ticket.tests.report import ReportTestCase
++
++from multiproduct.env import ProductEnvironment
++from tests.env import MultiproductTestCase
++
++class ProductReportTestCase(ReportTestCase, 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)
++        return env
++
++    @env.setter
++    def env(self, value):
++        pass
++
++    def tearDown(self):
++        self.global_env.reset_db()
++        self.global_env = self._env = None
++
++
++def test_suite():
++    return unittest.TestSuite([
++            # FIXME : Put report doctests in product context
++            # doctest.DocTestSuite(trac.ticket.report,)
++            unittest.makeSuite(ProductReportTestCase,'test'),
++        ])
++
++if __name__ == '__main__':
++    unittest.main(defaultTest='test_suite')
++