Commit c0a15df4 authored by Łukasz Nowak's avatar Łukasz Nowak

- simplify access to erp5_remote_manager

 - check that it is empited after bad excepion is raised


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39174 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 08834c02
......@@ -107,10 +107,10 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase):
def setUpRemoteUserManager(self):
acl_users = self.portal.acl_users
addERP5RemoteUserManager(acl_users, self.erp5_remote_manager_id)
erp5_remote_manager = getattr(acl_users, self.erp5_remote_manager_id)
self.erp5_remote_manager = getattr(acl_users, self.erp5_remote_manager_id)
erp5_users = getattr(acl_users, 'erp5_users')
erp5_users.manage_activateInterfaces(['IUserEnumerationPlugin'])
erp5_remote_manager.manage_activateInterfaces(['IAuthenticationPlugin'])
self.erp5_remote_manager.manage_activateInterfaces(['IAuthenticationPlugin'])
transaction.commit()
def afterSetUp(self):
......@@ -119,7 +119,6 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase):
self.setUpRemoteUserManager()
self.person_module = self.portal.person_module
acl_users = self.portal.acl_users
self.erp5_remote_manager = getattr(acl_users, self.erp5_remote_manager_id)
# set preferences before each test, as test suite can have different
# ip/port after being saved and then loaded
self.setUpAuthenticationServerPreferences()
......@@ -273,6 +272,9 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase):
self.assertRaises(ValueError,
self.portal.portal_wizard.callRemoteProxyMethod)
self.checkLogin(None, kw)
# assert that ZODB cache is emptied
self.assertFalse(login in \
self.erp5_remote_manager.remote_authentication_cache)
finally:
WizardTool.callRemoteProxyMethod = original_callRemoteProxyMethod
......
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