must now properly use Binary for password (see 4180:42247d70105b). XXX Though this is somewhat backend related (eg store password using a binary type), this should be either well document or handled properly in the db helper. stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 23 Dec 2009 08:59:01 +0100
branchstable
changeset 4199 c9526b1ffb1d
parent 4198 8d644eb862b9
child 4200 6701c65ee44b
must now properly use Binary for password (see 4180:42247d70105b). XXX Though this is somewhat backend related (eg store password using a binary type), this should be either well document or handled properly in the db helper.
server/test/unittest_querier.py
--- a/server/test/unittest_querier.py	Wed Dec 23 08:56:38 2009 +0100
+++ b/server/test/unittest_querier.py	Wed Dec 23 08:59:01 2009 +0100
@@ -1079,7 +1079,8 @@
                        % (SQL_PREFIX, SQL_PREFIX, SQL_PREFIX))
         passwd = str(cursor.fetchone()[0])
         self.assertEquals(passwd, crypt_password('toto', passwd[:2]))
-        rset = self.execute("Any X WHERE X is CWUser, X login 'bob', X upassword '%s'" % passwd)
+        rset = self.execute("Any X WHERE X is CWUser, X login 'bob', X upassword %(pwd)s",
+                            {'pwd': Binary(passwd)})
         self.assertEquals(len(rset.rows), 1)
         self.assertEquals(rset.description, [('CWUser',)])
 
@@ -1093,7 +1094,8 @@
                        % (SQL_PREFIX, SQL_PREFIX, SQL_PREFIX))
         passwd = str(cursor.fetchone()[0])
         self.assertEquals(passwd, crypt_password('tutu', passwd[:2]))
-        rset = self.execute("Any X WHERE X is CWUser, X login 'bob', X upassword '%s'" % passwd)
+        rset = self.execute("Any X WHERE X is CWUser, X login 'bob', X upassword %(pwd)s",
+                            {'pwd': Binary(passwd)})
         self.assertEquals(len(rset.rows), 1)
         self.assertEquals(rset.description, [('CWUser',)])