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

fixup! more generic zope4py3 fixes

parent 05bac429
Pipeline #34328 failed with stage
in 0 seconds
...@@ -237,13 +237,13 @@ class TestAuthenticationPolicy(ERP5TypeTestCase): ...@@ -237,13 +237,13 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
self.tic() self.tic()
# password change date should be saved as well hashed old password value # password change date should be saved as well hashed old password value
old_password = login.getPassword().decode() old_password = login.getPassword()
self.assertSameSet([old_password], [x.getPassword() for x in self._getPasswordEventList(login)]) self.assertSameSet([old_password], [x.getPassword() for x in self._getPasswordEventList(login)])
# .. test one more time to check history of password is saved in a list # .. test one more time to check history of password is saved in a list
login.setPassword('123456789') login.setPassword('123456789')
self.tic() self.tic()
old_password1 = login.getPassword().decode() old_password1 = login.getPassword()
# password change date should be saved as well hashed old password value # password change date should be saved as well hashed old password value
self.assertSameSet([old_password1, old_password], [x.getPassword() for x in self._getPasswordEventList(login)]) self.assertSameSet([old_password1, old_password], [x.getPassword() for x in self._getPasswordEventList(login)])
...@@ -251,29 +251,29 @@ class TestAuthenticationPolicy(ERP5TypeTestCase): ...@@ -251,29 +251,29 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
# other methods (_setPassword)... # other methods (_setPassword)...
login._setPassword('123456789-1') login._setPassword('123456789-1')
self.tic() self.tic()
old_password2 = login.getPassword().decode() old_password2 = login.getPassword()
self.assertSameSet([old_password2, old_password1, old_password], \ self.assertSameSet([old_password2, old_password1, old_password], \
[x.getPassword() for x in self._getPasswordEventList(login)]) [x.getPassword() for x in self._getPasswordEventList(login)])
# other methods (_forceSetPassword)... # other methods (_forceSetPassword)...
login._forceSetPassword('123456789-2') login._forceSetPassword('123456789-2')
self.tic() self.tic()
old_password3 = login.getPassword().decode() old_password3 = login.getPassword()
self.assertSameSet([old_password3, old_password2, old_password1, old_password], \ self.assertSameSet([old_password3, old_password2, old_password1, old_password], \
[x.getPassword() for x in self._getPasswordEventList(login)]) [x.getPassword() for x in self._getPasswordEventList(login)])
# other methods (setEncodedPassword)... # other methods (setEncodedPassword)...
login.setEncodedPassword(b'123456789-3') login.setEncodedPassword('123456789-3')
self.tic() self.tic()
old_password4 = login.getPassword().decode() old_password4 = login.getPassword()
self.assertSameSet([old_password4, old_password3, old_password2, old_password1, old_password], \ self.assertSameSet([old_password4, old_password3, old_password2, old_password1, old_password], \
[x.getPassword() for x in self._getPasswordEventList(login)]) [x.getPassword() for x in self._getPasswordEventList(login)])
# other methods (edit)... # other methods (edit)...
login.edit(password = '123456789-4') login.edit(password = '123456789-4')
self.tic() self.tic()
old_password5 = login.getPassword().decode() old_password5 = login.getPassword()
self.assertSameSet([old_password5, old_password4, old_password3, old_password2, old_password1, old_password], \ self.assertSameSet([old_password5, old_password4, old_password3, old_password2, old_password1, old_password], \
[x.getPassword() for x in self._getPasswordEventList(login)]) [x.getPassword() for x in self._getPasswordEventList(login)])
......
...@@ -2079,9 +2079,11 @@ class TestImage(ERP5TypeTestCase): ...@@ -2079,9 +2079,11 @@ class TestImage(ERP5TypeTestCase):
""" """
def makeImageFileUpload(self, filename): def makeImageFileUpload(self, filename):
import Products.ERP5.tests import Products.ERP5.tests
return FileUpload( fu = FileUpload(
os.path.join(os.path.dirname(Products.ERP5.tests.__file__), os.path.join(os.path.dirname(Products.ERP5.tests.__file__),
'test_data', 'images', filename)) 'test_data', 'images', filename))
self.addCleanup(fu.close)
return fu
def test_CreateImage(self): def test_CreateImage(self):
# We can add Images inside Persons and Organisation # We can add Images inside Persons and Organisation
......
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