Commit 44d99881 authored by Łukasz Nowak's avatar Łukasz Nowak

- check that ZODB cache is properly invalidated in case of wrong login


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39176 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 918cc7ba
...@@ -408,6 +408,21 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase): ...@@ -408,6 +408,21 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase):
finally: finally:
WizardTool.callRemoteProxyMethod = original_callRemoteProxyMethod WizardTool.callRemoteProxyMethod = original_callRemoteProxyMethod
def test_wrong_login_clears_zodb_cache(self):
"""Check that wrong login attempt clears ZODB cache"""
login = 'someone'
password = 'somepass'
self.createPerson(login, password)
transaction.commit()
self.tic()
kw = {'login':login, 'password': password}
self.checkLogin(('someone', 'someone'), kw)
self.assertTrue(login in \
self.erp5_remote_manager.remote_authentication_cache)
self.checkLogin(None, {'login':kw['login'], 'password':'wrong_password'})
self.assertFalse(login in \
self.erp5_remote_manager.remote_authentication_cache)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5RemoteUserManager)) suite.addTest(unittest.makeSuite(TestERP5RemoteUserManager))
......
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