tests: Refine external_authentication_methods.

This removes our last use of `check_dict` in
`zerver/tests`, except for `test_decorators.py`,
which is testing the function itself.
This commit is contained in:
Steve Howell 2020-06-25 21:52:28 +00:00 committed by Tim Abbott
parent a46c28eea2
commit 7c2be24cf8
1 changed files with 11 additions and 2 deletions

View File

@ -70,10 +70,10 @@ from zerver.lib.utils import generate_random_token
from zerver.lib.validator import (
Validator,
check_bool,
check_dict,
check_dict_only,
check_int,
check_list,
check_none_or,
check_string,
validate_login_email,
)
@ -3311,7 +3311,16 @@ class FetchAuthBackends(ZulipTestCase):
self.assert_json_success(result)
checker = check_dict_only([
('authentication_methods', check_dict_only(authentication_methods_list)),
('external_authentication_methods', check_list(check_dict(), length=len(external_auth_methods))),
('external_authentication_methods', check_list(
check_dict_only([
('display_icon', check_none_or(check_string)),
('display_name', check_string),
('login_url', check_string),
('name', check_string),
('signup_url', check_string),
]),
length=len(external_auth_methods)
)),
('email_auth_enabled', check_bool),
('is_incompatible', check_bool),
('require_email_format_usernames', check_bool),