server_settings: Add additional subdomains test case.

This will help preserve 100% test coverage as we refactor to set
REALMS_HAVE_SUBDOMAINS=True unconditonally.
This commit is contained in:
Tim Abbott 2017-08-25 14:59:49 -07:00
parent 64e895533b
commit ba64d4ee29
1 changed files with 21 additions and 1 deletions

View File

@ -1443,7 +1443,27 @@ class FetchAuthBackends(ZulipTestCase):
with self.settings(REALMS_HAVE_SUBDOMAINS=True,
ROOT_DOMAIN_LANDING_PAGE=False):
result = self.client_get("/api/v1/server_settings",
HTTP_HOST="zulip.testserver")
subdomain="")
self.assert_json_success(result)
data = result.json()
schema_checker = check_dict_only([
('authentication_methods', check_dict_only([
('google', check_bool),
('github', check_bool),
('dev', check_bool),
('password', check_bool),
])),
('realm_uri', check_string),
('zulip_version', check_string),
('msg', check_string),
('result', check_string),
])
self.assert_on_error(schema_checker("data", data))
with self.settings(REALMS_HAVE_SUBDOMAINS=True,
ROOT_DOMAIN_LANDING_PAGE=False):
result = self.client_get("/api/v1/server_settings",
subdomain="zulip")
self.assert_json_success(result)
data = result.json()
with_realm_schema_checker = check_dict_only([