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

- check bad incorrect login works correctly in case of no connection to

   authentication server


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39150 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa2c66ab
...@@ -117,7 +117,6 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase): ...@@ -117,7 +117,6 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase):
self.portal.acl_users.manage_delObjects(self.erp5_remote_manager_id) self.portal.acl_users.manage_delObjects(self.erp5_remote_manager_id)
self.portal.deleteContent('portal_witch') self.portal.deleteContent('portal_witch')
self.removeAuthenticationServerPreferences() self.removeAuthenticationServerPreferences()
self.portal.portal_caches.clearAllCache()
transaction.commit() transaction.commit()
self.tic() self.tic()
self.person_module.deleteContent(list(self.person_module.objectIds())) self.person_module.deleteContent(list(self.person_module.objectIds()))
...@@ -128,6 +127,7 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase): ...@@ -128,6 +127,7 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase):
portal_preferences = self.portal.portal_preferences portal_preferences = self.portal.portal_preferences
if self.system_preference_id in portal_preferences.objectIds(): if self.system_preference_id in portal_preferences.objectIds():
portal_preferences.deleteContent(self.system_preference_id) portal_preferences.deleteContent(self.system_preference_id)
self.portal.portal_caches.clearAllCache()
def setUpAuthenticationServerPreferences(self, server_url=None, def setUpAuthenticationServerPreferences(self, server_url=None,
server_root=None): server_root=None):
...@@ -183,6 +183,18 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase): ...@@ -183,6 +183,18 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase):
self.assertEqual(None, self.assertEqual(None,
self.erp5_remote_manager.authenticateCredentials(kw)) self.erp5_remote_manager.authenticateCredentials(kw))
def test_incorrect_login_in_case_of_no_connection(self):
login = 'someone'
password = 'somepass'
self.createPerson(login, password)
transaction.commit()
self.tic()
kw = {'login':login, 'password': password}
self.removeAuthenticationServerPreferences()
transaction.commit()
self.tic()
self.assertEqual(None, self.erp5_remote_manager.authenticateCredentials(kw))
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