[testlib] use internal_cnx instead of internal_session
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 27 Jun 2013 12:28:17 +0200
changeset 9114 9a9d3f4bad31
parent 9113 af6efc15fc90
child 9115 fcc732a9d9ac
[testlib] use internal_cnx instead of internal_session internal_session is deprecated.
devtools/testlib.py
--- a/devtools/testlib.py	Thu Jun 27 14:12:00 2013 +0200
+++ b/devtools/testlib.py	Thu Jun 27 12:28:17 2013 +0200
@@ -281,8 +281,8 @@
         # get an admin session (without actual login)
         sources = db_handler.config.sources()
         login = unicode(sources['admin']['login'])
-        with self.repo.internal_session() as session:
-            rset = session.execute('CWUser U WHERE U login %(u)s', {'u': login})
+        with self.repo.internal_cnx() as cnx:
+            rset = cnx.execute('CWUser U WHERE U login %(u)s', {'u': login})
             user = rset.get_entity(0, 0)
             user.groups
             user.properties