server/test/unittest_rql2sql.py
changeset 6631 26c303c3f1aa
parent 6493 019ab5eb37ea
child 6781 5062d86d6ffe
--- a/server/test/unittest_rql2sql.py	Mon Oct 25 16:28:05 2010 +0200
+++ b/server/test/unittest_rql2sql.py	Mon Oct 25 17:15:46 2010 +0200
@@ -38,12 +38,14 @@
     pass # already registered
 
 
-config = TestServerConfiguration('data')
-config.bootstrap_cubes()
-schema = config.load_schema()
-schema['in_state'].inlined = True
-schema['state_of'].inlined = False
-schema['comments'].inlined = False
+def setup_module(*args):
+    global config, schema
+    config = TestServerConfiguration('data', apphome=CWRQLTC.datadir)
+    config.bootstrap_cubes()
+    schema = config.load_schema()
+    schema['in_state'].inlined = True
+    schema['state_of'].inlined = False
+    schema['comments'].inlined = False
 
 def teardown_module(*args):
     global config, schema
@@ -1076,8 +1078,12 @@
 
     ]
 class CWRQLTC(RQLGeneratorTC):
-    schema = schema
     backend = 'sqlite'
+
+    def setUp(self):
+        self.__class__.schema = schema
+        super(CWRQLTC, self).setUp()
+
     def test_nonregr_sol(self):
         delete = self.rqlhelper.parse(
             'DELETE X read_permission READ_PERMISSIONSUBJECT,X add_permission ADD_PERMISSIONSUBJECT,'
@@ -1105,9 +1111,12 @@
     return '\n'.join(l.strip() for l in text.strip().splitlines())
 
 class PostgresSQLGeneratorTC(RQLGeneratorTC):
-    schema = schema
     backend = 'postgres'
 
+    def setUp(self):
+        self.__class__.schema = schema
+        super(PostgresSQLGeneratorTC, self).setUp()
+
     def _norm_sql(self, sql):
         return sql.strip()