password can now be given as optional argument
authorsylvain.thenault@logilab.fr
Mon, 12 Jan 2009 10:57:51 +0100
changeset 387 dbe9997ffc7e
parent 386 7af259b73c5b
child 388 4e23b542f8ad
password can now be given as optional argument
devtools/_apptest.py
devtools/apptest.py
--- a/devtools/_apptest.py	Mon Jan 12 10:57:26 2009 +0100
+++ b/devtools/_apptest.py	Mon Jan 12 10:57:51 2009 +0100
@@ -130,11 +130,12 @@
         self._orig_cnx.commit()
         return user
 
-    def login(self, login):
+    def login(self, login, password=None):
         if login == self.admlogin:
             self.restore_connection()
         else:
-            self.cnx = repo_connect(self.repo, unicode(login), str(login),
+            self.cnx = repo_connect(self.repo, unicode(login),
+                                    password or str(login),
                                     ConnectionProperties('inmemory'))
         if login == self.vreg.config.anonymous_user()[0]:
             self.cnx.anonymous_connection = True
--- a/devtools/apptest.py	Mon Jan 12 10:57:26 2009 +0100
+++ b/devtools/apptest.py	Mon Jan 12 10:57:51 2009 +0100
@@ -111,8 +111,8 @@
     def create_user(self, *args, **kwargs):
         return self.env.create_user(*args, **kwargs)
 
-    def login(self, login):
-        return self.env.login(login)
+    def login(self, login, password=None):
+        return self.env.login(login, password)
 
     def restore_connection(self):
         self.env.restore_connection()