saml: Sanity-check configuration in both login and signup codepaths.

This commit is contained in:
Mateusz Mandera
2019-10-26 01:51:48 +02:00
committed by Tim Abbott
parent db29fcbbc4
commit b870816a75
3 changed files with 32 additions and 13 deletions

View File

@@ -1053,6 +1053,12 @@ class SAMLAuthBackendTest(SocialAuthBase):
self.assertEqual(result.status_code, 302)
self.assertEqual(result.url, self.CONFIG_ERROR_URL)
# Test the signup path too:
result = self.social_auth_test(account_data_dict, is_signup='1',
subdomain='zulip', next='/user_uploads/image')
self.assertEqual(result.status_code, 302)
self.assertEqual(result.url, self.CONFIG_ERROR_URL)
def test_saml_auth_works_without_private_public_keys(self) -> None:
with self.settings(SOCIAL_AUTH_SAML_SP_PUBLIC_CERT='', SOCIAL_AUTH_SAML_SP_PRIVATE_KEY=''):
self.test_social_auth_success()