[Erp5-report] r39176 luke - /erp5/trunk/products/ERP5Wizard/tests/testERP5RemoteUserManager.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 14 16:54:34 CEST 2010


Author: luke
Date: Thu Oct 14 16:54:32 2010
New Revision: 39176

URL: http://svn.erp5.org?rev=39176&view=rev
Log:
 - check that ZODB cache is properly invalidated in case of wrong login

Modified:
    erp5/trunk/products/ERP5Wizard/tests/testERP5RemoteUserManager.py

Modified: erp5/trunk/products/ERP5Wizard/tests/testERP5RemoteUserManager.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Wizard/tests/testERP5RemoteUserManager.py?rev=39176&r1=39175&r2=39176&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Wizard/tests/testERP5RemoteUserManager.py [utf8] (original)
+++ erp5/trunk/products/ERP5Wizard/tests/testERP5RemoteUserManager.py [utf8] Thu Oct 14 16:54:32 2010
@@ -408,6 +408,21 @@ class TestERP5RemoteUserManager(ERP5Type
     finally:
       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():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(TestERP5RemoteUserManager))




More information about the Erp5-report mailing list