[test] silence a few more deprecation warnings in unittest_hooks
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 28 Jul 2014 17:22:49 +0200
changeset 9935 d1adf549d5cb
parent 9934 e32964e28a45
child 9936 5dbf45204109
[test] silence a few more deprecation warnings in unittest_hooks self.session → cnx.
hooks/test/unittest_hooks.py
--- a/hooks/test/unittest_hooks.py	Fri Jul 25 16:24:44 2014 +0200
+++ b/hooks/test/unittest_hooks.py	Mon Jul 28 17:22:49 2014 +0200
@@ -122,14 +122,14 @@
             entity = cnx.create_entity('Bookmark', title=u'wf1', path=u'/view')
             cnx.commit() # fire operations
             self.assertEqual(len(entity.created_by), 1) # make sure we have only one creator
-            self.assertEqual(entity.created_by[0].eid, self.session.user.eid)
+            self.assertEqual(entity.created_by[0].eid, cnx.user.eid)
 
     def test_metadata_owned_by(self):
         with self.admin_access.repo_cnx() as cnx:
             entity = cnx.create_entity('Bookmark', title=u'wf1', path=u'/view')
             cnx.commit() # fire operations
             self.assertEqual(len(entity.owned_by), 1) # make sure we have only one owner
-            self.assertEqual(entity.owned_by[0].eid, self.session.user.eid)
+            self.assertEqual(entity.owned_by[0].eid, cnx.user.eid)
 
     def test_user_login_stripped(self):
         with self.admin_access.repo_cnx() as cnx:
@@ -153,7 +153,7 @@
                               self.repo.connect, u'toto', password='hop')
             cnx.commit()
             cnxid = self.repo.connect(u'toto', password='hop')
-            self.assertNotEqual(cnxid, self.session.id)
+            self.assertNotEqual(cnxid, cnx.sessionid)
             cnx.execute('DELETE CWUser X WHERE X login "toto"')
             self.repo.execute(cnxid, 'State X')
             cnx.commit()