--- a/cubicweb/server/test/unittest_security.py Fri Mar 10 12:07:29 2017 +0100
+++ b/cubicweb/server/test/unittest_security.py Fri Mar 10 18:24:40 2017 +0100
@@ -86,14 +86,12 @@
"WHERE cw_login = 'oldpassword'").fetchone()[0]
oldhash = self.repo.system_source.binary_to_str(oldhash)
session = self.repo.new_session('oldpassword', password='oldpassword')
- session.close()
newhash = cnx.system_sql("SELECT cw_upassword FROM cw_CWUser "
"WHERE cw_login = 'oldpassword'").fetchone()[0]
newhash = self.repo.system_source.binary_to_str(newhash)
self.assertNotEqual(oldhash, newhash)
self.assertTrue(newhash.startswith(b'$6$'))
session = self.repo.new_session('oldpassword', password='oldpassword')
- session.close()
newnewhash = cnx.system_sql("SELECT cw_upassword FROM cw_CWUser WHERE "
"cw_login = 'oldpassword'").fetchone()[0]
newnewhash = self.repo.system_source.binary_to_str(newnewhash)
@@ -305,8 +303,7 @@
cnx.execute('SET X upassword %(passwd)s WHERE X eid %(x)s',
{'x': ueid, 'passwd': b'newpwd'})
cnx.commit()
- session = self.repo.new_session('user', password='newpwd')
- session.close()
+ self.repo.new_session('user', password='newpwd')
def test_user_cant_change_other_upassword(self):
with self.admin_access.repo_cnx() as cnx: