27 |
27 |
28 from logilab.common.testlib import TestCase, unittest_main |
28 from logilab.common.testlib import TestCase, unittest_main |
29 from rql import BadRQLQuery |
29 from rql import BadRQLQuery |
30 from rql.utils import register_function, FunctionDescr |
30 from rql.utils import register_function, FunctionDescr |
31 |
31 |
32 from cubicweb import QueryError, Unauthorized, Binary |
32 from cubicweb import QueryError, Unauthorized, Binary, devtools |
33 from cubicweb.server.sqlutils import SQL_CONNECT_HOOKS, SQL_PREFIX |
33 from cubicweb.server.sqlutils import SQL_CONNECT_HOOKS, SQL_PREFIX |
34 from cubicweb.server.utils import crypt_password |
34 from cubicweb.server.utils import crypt_password |
35 from cubicweb.server.querier import manual_build_descr, _make_description |
35 from cubicweb.server.querier import manual_build_descr, _make_description |
36 from cubicweb.devtools import get_test_db_handler, TestServerConfiguration |
|
37 from cubicweb.devtools.testlib import CubicWebTC |
36 from cubicweb.devtools.testlib import CubicWebTC |
38 from cubicweb.devtools.repotest import tuplify, BaseQuerierTC |
37 from cubicweb.devtools.repotest import tuplify, BaseQuerierTC |
39 |
38 |
40 |
39 |
41 class FixedOffset(tzinfo): |
40 class FixedOffset(tzinfo): |
71 SQL_CONNECT_HOOKS['sqlite'].append(init_sqlite_connexion) |
70 SQL_CONNECT_HOOKS['sqlite'].append(init_sqlite_connexion) |
72 |
71 |
73 |
72 |
74 def setUpClass(cls, *args): |
73 def setUpClass(cls, *args): |
75 global repo, cnx |
74 global repo, cnx |
76 config = TestServerConfiguration('data', __file__) |
75 config = devtools.TestServerConfiguration('data', __file__) |
77 handler = get_test_db_handler(config) |
76 handler = devtools.get_test_db_handler(config) |
78 handler.build_db_cache() |
77 handler.build_db_cache() |
79 repo, cnx = handler.get_repo_and_cnx() |
78 repo, cnx = handler.get_repo_and_cnx() |
80 cls.repo = repo |
79 cls.repo = repo |
81 |
80 |
82 def tearDownClass(cls, *args): |
81 def tearDownClass(cls, *args): |