summaryrefslogtreecommitdiff
path: root/addons/document_ftp/test_easyftp.py
diff options
context:
space:
mode:
authorP. Christeas <p_christ@hol.gr>2010-12-28 18:58:14 +0200
committerP. Christeas <p_christ@hol.gr>2010-12-28 18:58:14 +0200
commitd807742f50b70fbac0ec3a7675d2f2efc4c040fc (patch)
treefe48c6100186731756cce7e3aef339fca4511279 /addons/document_ftp/test_easyftp.py
parent545f5421c3f80d6dd5816006ce2155d599e23cae (diff)
doc ftp,webdav: fallback to passwd=login when using base_crypt
At the test scripts for these modules, we need to know the password for the user that's making the tests. If we detect that passwords are hashed by base_crypt, don't use them and attempt to assume that login=passwd. bzr revid: p_christ@hol.gr-20101228165814-sfbyxy9ngryyfaea
Diffstat (limited to 'addons/document_ftp/test_easyftp.py')
-rw-r--r--addons/document_ftp/test_easyftp.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/document_ftp/test_easyftp.py b/addons/document_ftp/test_easyftp.py
index 1f7324b821e..fbc142c1267 100644
--- a/addons/document_ftp/test_easyftp.py
+++ b/addons/document_ftp/test_easyftp.py
@@ -37,7 +37,12 @@ def get_plain_ftp(timeout=10.0):
def get_ftp_login(cr, uid, ormobj):
ftp = get_plain_ftp()
user = ormobj.pool.get('res.users').read(cr, uid, uid)
- ftp.login(user.get('login',''), user.get('password',''))
+ passwd = user.get('password','')
+ if passwd.startswith("$1$"):
+ # md5 by base crypt. We cannot decode, wild guess
+ # that passwd = login
+ passwd = user.get('login', '')
+ ftp.login(user.get('login',''), passwd)
ftp.cwd("/" + cr.dbname)
return ftp