[test] drop some deprecation warnings stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 21 Oct 2011 09:23:43 +0200
branchstable
changeset 7977 e2d3ff3e7660
parent 7976 48e1f7992507
child 7978 b6150210f692
[test] drop some deprecation warnings
server/test/unittest_ssplanner.py
server/test/unittest_storage.py
--- a/server/test/unittest_ssplanner.py	Fri Oct 21 09:23:43 2011 +0200
+++ b/server/test/unittest_ssplanner.py	Fri Oct 21 09:23:43 2011 +0200
@@ -16,14 +16,18 @@
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
 
-from cubicweb.devtools import init_test_database
+from cubicweb.devtools import TestServerConfiguration, get_test_db_handler
 from cubicweb.devtools.repotest import BasePlannerTC, test_plan
 from cubicweb.server.ssplanner import SSPlanner
 
 # keep cnx so it's not garbage collected and the associated session closed
 def setUpModule(*args):
     global repo, cnx
-    repo, cnx = init_test_database(apphome=SSPlannerTC.datadir)
+    handler = get_test_db_handler(TestServerConfiguration(
+            'data', apphome=SSPlannerTC.datadir))
+    handler.build_db_cache()
+    global repo, cnx
+    repo, cnx = handler.get_repo_and_cnx()
 
 def tearDownModule(*args):
     global repo, cnx
--- a/server/test/unittest_storage.py	Fri Oct 21 09:23:43 2011 +0200
+++ b/server/test/unittest_storage.py	Fri Oct 21 09:23:43 2011 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -261,7 +261,7 @@
     def test_bfss_update_to_None(self):
         f = self.session.create_entity('Affaire', opt_attr=Binary('toto'))
         self.session.commit()
-        self.session.set_pool()
+        self.session.set_cnxset()
         f.set_attributes(opt_attr=None)
         self.session.commit()