Skip to content

Commit

Permalink
test_decorators: Replace the json/fetch_api_key endpoint in tests.
Browse files Browse the repository at this point in the history
This endpoint is about to become an API-style route and have the legacy
decorator removed from its view. Other endpoints will be used in tests
instead of it.
  • Loading branch information
alenavolk authored and showell committed Jan 8, 2018
1 parent b583f1f commit 7c22045
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zerver/tests/test_decorators.py
Expand Up @@ -1078,8 +1078,10 @@ def test_authenticated_json_post_view_if_user_realm_is_deactivated(self) -> None
do_reactivate_realm(user_profile.realm)

def _do_test(self, user_email: Text) -> HttpResponse:
data = {"password": initial_password(user_email)}
return self.client_post(r'/json/fetch_api_key', data)
stream_name = "stream name"
self.common_subscribe_to_streams(user_email, [stream_name])
data = {"password": initial_password(user_email), "stream": stream_name}
return self.client_post(r'/json/subscriptions/exists', data)

def _login(self, user_email: Text, user_realm: Realm, password: str=None) -> None:
if password:
Expand Down Expand Up @@ -1113,7 +1115,7 @@ def test_authenticated_json_view_if_subdomain_is_invalid(self) -> None:

def _do_test(self, user_email: str) -> HttpResponse:
data = {"password": initial_password(user_email)}
return self.client_post(r'/json/fetch_api_key', data)
return self.client_post(r'/accounts/webathena_kerberos_login/', data)

class TestZulipLoginRequiredDecorator(ZulipTestCase):
def test_zulip_login_required_if_subdomain_is_invalid(self) -> None:
Expand Down

0 comments on commit 7c22045

Please sign in to comment.