test/unittest_rqlrewrite.py
changeset 6640 4c4616c02f69
parent 6340 470d8e828fda
child 6781 5062d86d6ffe
--- a/test/unittest_rqlrewrite.py	Mon Oct 25 17:53:42 2010 +0200
+++ b/test/unittest_rqlrewrite.py	Mon Oct 25 17:54:00 2010 +0200
@@ -26,20 +26,23 @@
 from cubicweb.rqlrewrite import RQLRewriter
 from cubicweb.devtools import repotest, TestServerConfiguration
 
-config = TestServerConfiguration('data/rewrite')
-config.bootstrap_cubes()
-schema = config.load_schema()
-from yams.buildobjs import RelationDefinition
-schema.add_relation_def(RelationDefinition(subject='Card', name='in_state', object='State', cardinality='1*'))
-
-rqlhelper = RQLHelper(schema, special_relations={'eid': 'uid',
-                                                 'has_text': 'fti'})
 
 def setup_module(*args):
+    global rqlhelper, schema
+    config = TestServerConfiguration(RQLRewriteTC.datapath('rewrite'))
+    config.bootstrap_cubes()
+    schema = config.load_schema()
+    from yams.buildobjs import RelationDefinition
+    schema.add_relation_def(RelationDefinition(subject='Card', name='in_state', object='State', cardinality='1*'))
+
+    rqlhelper = RQLHelper(schema, special_relations={'eid': 'uid',
+                                                     'has_text': 'fti'})
     repotest.do_monkey_patch()
 
 def teardown_module(*args):
     repotest.undo_monkey_patch()
+    global rqlhelper, schema
+    del rqlhelper, schema
 
 def eid_func_map(eid):
     return {1: 'CWUser',