[ms test] fix nasty cache effect break unittest_multisources.test_not_relation since introduction of local_eid method andfor full dereferencement of external eids stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 05 Nov 2010 09:12:57 +0100
branchstable
changeset 6671 c34fa947df07
parent 6670 e22bd5eb6ffd
child 6672 2008fd2f628c
[ms test] fix nasty cache effect break unittest_multisources.test_not_relation since introduction of local_eid method andfor full dereferencement of external eids
devtools/repotest.py
--- a/devtools/repotest.py	Thu Nov 04 10:58:29 2010 +0100
+++ b/devtools/repotest.py	Fri Nov 05 09:12:57 2010 +0100
@@ -22,6 +22,7 @@
 
 __docformat__ = "restructuredtext en"
 
+from copy import deepcopy
 from pprint import pprint
 
 from logilab.common.decorators import clear_cache
@@ -388,6 +389,11 @@
                 return x.value
     return _orig_choose_term(self, DumbOrderedDict2(sourceterms, get_key))
 
+from cubicweb.server.sources.pyrorql import PyroRQLSource
+_orig_syntax_tree_search = PyroRQLSource.syntax_tree_search
+
+def _syntax_tree_search(*args, **kwargs):
+    return deepcopy(_orig_syntax_tree_search(*args, **kwargs))
 
 def do_monkey_patch():
     RQLRewriter.insert_snippets = _insert_snippets
@@ -397,6 +403,7 @@
     ExecutionPlan.init_temp_table = _init_temp_table
     PartPlanInformation.merge_input_maps = _merge_input_maps
     PartPlanInformation._choose_term = _choose_term
+    PyroRQLSource.syntax_tree_search = _syntax_tree_search
 
 def undo_monkey_patch():
     RQLRewriter.insert_snippets = _orig_insert_snippets
@@ -405,3 +412,4 @@
     ExecutionPlan.init_temp_table = _orig_init_temp_table
     PartPlanInformation.merge_input_maps = _orig_merge_input_maps
     PartPlanInformation._choose_term = _orig_choose_term
+    PyroRQLSource.syntax_tree_search = _orig_syntax_tree_search