Fixed server mode api test case failure.

This commit is contained in:
Ashesh Vashi
2021-06-24 19:41:58 +05:30
committed by Akshay Joshi
parent 9574f43f87
commit cfb68d73a0
6 changed files with 15 additions and 13 deletions

View File

@@ -57,13 +57,13 @@ class LDAPLoginMockTestCase(BaseTestGenerator):
app_config.LDAP_BIND_USER = None
app_config.LDAP_BIND_PASSWORD = None
@patch.object(AuthSourceRegistry.registry['ldap'], 'connect',
@patch.object(AuthSourceRegistry._registry['ldap'], 'connect',
return_value=[True, "Done"])
@patch.object(AuthSourceRegistry.registry['ldap'], 'search_ldap_user',
@patch.object(AuthSourceRegistry._registry['ldap'], 'search_ldap_user',
return_value=[True, ''])
def runTest(self, conn_mock_obj, search_mock_obj):
"""This function checks ldap login functionality."""
AuthSourceRegistry.registry['ldap'].dedicated_user = False
AuthSourceRegistry._registry['ldap'].dedicated_user = False
res = self.tester.login(self.username, self.password, True)
respdata = 'Gravatar image for %s' % self.username
self.assertTrue(respdata in res.data.decode('utf8'))