cubicweb/server/test/unittest_rql2sql.py
changeset 12236 75a6b2f40c44
parent 12235 03b94c9863de
child 12296 23bc9f385645
--- a/cubicweb/server/test/unittest_rql2sql.py	Fri Sep 15 16:25:51 2017 +0200
+++ b/cubicweb/server/test/unittest_rql2sql.py	Fri Sep 15 16:31:33 2017 +0200
@@ -23,7 +23,6 @@
 
 from logilab import database as db
 from logilab.common.testlib import mock_object
-from logilab.common.decorators import monkeypatch
 
 from rql import BadRQLQuery
 from rql import RQLHelper
@@ -39,22 +38,6 @@
 _orig_select_principal = rqlannotation._select_principal
 _orig_check_permissions = ExecutionPlan._check_permissions
 
-
-def setUpModule():
-    """Monkey-patch the SQL generator to ensure solutions order is predictable."""
-    global orig_solutions_sql
-    orig_solutions_sql = rql2sql.SQLGenerator._solutions_sql
-
-    @monkeypatch
-    def _solutions_sql(self, select, solutions, distinct, needalias):
-        return orig_solutions_sql(self, select, sorted(solutions), distinct, needalias)
-
-
-def tearDownModule():
-    """Remove monkey-patch done in setUpModule"""
-    rql2sql.SQLGenerator._solutions_sql = orig_solutions_sql
-
-
 # add a dumb registered procedure
 class stockproc(FunctionDescr):
     supported_backends = ('postgres', 'sqlite', 'mysql')