Commit ad6e3bcb authored by Jérome Perrin's avatar Jérome Perrin

explicitly pass REQUEST in the test, so that PasswordTool does not use get_request.

When using --load, PasswordTool will be imported very early in the ZODB
initialisation, before ERP5TypeTestCase has a chance to patch get_request,
PasswordTool imports get_request at module level, so PasswordTool uses the
original get_request which is not functional in tests.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38395 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent be5df60e
......@@ -447,7 +447,8 @@ class TestPasswordTool(ERP5TypeTestCase):
transaction.commit()
self.tic()
self.logout()
ret = self.portal.portal_password.mailPasswordResetRequest(user_login='user')
ret = self.portal.portal_password.mailPasswordResetRequest(
user_login='user', REQUEST=self.portal.REQUEST)
self.assertTrue("portal_status_message=User+user+does+not+have+an+email+"\
"address%2C+please+contact+site+administrator+directly" in str(ret))
......@@ -466,7 +467,8 @@ class TestPasswordTool(ERP5TypeTestCase):
self.tic()
self._assertUserExists('user', 'password')
self.logout()
ret = self.portal.portal_password.mailPasswordResetRequest(user_login='user')
ret = self.portal.portal_password.mailPasswordResetRequest(
user_login='user', REQUEST=self.portal.REQUEST)
self.assertTrue("portal_status_message=User+user+does+not+have+an+email+"\
"address%2C+please+contact+site+administrator+directly" in str(ret))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment