mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
test_classes: Check responses in ZulipTestCase.register.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
41e7d52c65
commit
bae4182e47
@@ -651,9 +651,13 @@ Output:
|
|||||||
def logout(self) -> None:
|
def logout(self) -> None:
|
||||||
self.client.logout()
|
self.client.logout()
|
||||||
|
|
||||||
def register(self, email: str, password: str, **kwargs: Any) -> "TestHttpResponse":
|
def register(self, email: str, password: str, subdomain: str = DEFAULT_SUBDOMAIN) -> None:
|
||||||
self.client_post("/accounts/home/", {"email": email}, **kwargs)
|
response = self.client_post("/accounts/home/", {"email": email}, subdomain=subdomain)
|
||||||
return self.submit_reg_form_for_user(email, password, **kwargs)
|
self.assertEqual(response.status_code, 302)
|
||||||
|
self.assertEqual(response["Location"], f"/accounts/send_confirm/{email}")
|
||||||
|
response = self.submit_reg_form_for_user(email, password, subdomain=subdomain)
|
||||||
|
self.assertEqual(response.status_code, 302)
|
||||||
|
self.assertEqual(response["Location"], f"http://{Realm.host_for_subdomain(subdomain)}/")
|
||||||
|
|
||||||
def submit_reg_form_for_user(
|
def submit_reg_form_for_user(
|
||||||
self,
|
self,
|
||||||
|
|||||||
Reference in New Issue
Block a user