changeset 710:c599830cf185

Only patch test configuration database uri if the version of Trac has support for different test databases.
author hodgestar
date Wed, 28 Oct 2009 22:17:02 +0000
parents 0d7d6552477e
children f9f5d618fbbf
files bitten/tests/upgrades.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/tests/upgrades.py
+++ b/bitten/tests/upgrades.py
@@ -30,7 +30,12 @@
 
     def setUp(self):
         self.env = EnvironmentStub()
-        self.env.config.set('trac', 'database', self.env.dburi)
+        if hasattr(self.env, 'dburi'):
+            # Trac gained support for testing against different databases in 0.11.5
+            # If this support is available, we copy the test db uri configuration
+            # into the main test config so it can be picked up by
+            # upgrades._parse_scheme()
+            self.env.config.set('trac', 'database', self.env.dburi)
         self.env.path = tempfile.mkdtemp()
         logs_dir = self.env.config.get("bitten", "logs_dir")
         if os.path.isabs(logs_dir):
Copyright (C) 2012-2017 Edgewall Software