Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_signup: Use verify_signup helper when possible.

Alex Vandiver50c80c6ff9b9
diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py
index bee9943da8e..56e0dd4117a 100644
--- a/zerver/tests/test_signup.py
+++ b/zerver/tests/test_signup.py
@@ -2391,37 +2391,10 @@ class UserSignUpTest(ZulipTestCase):
"""
- result = self.client_post("/accounts/home/", {"email": email})
- self.assertEqual(result.status_code, 302)
- self.assertTrue(
- result["Location"].endswith(
- f"/accounts/send_confirm/?email={urllib.parse.quote(email)}"
- )
- )
- result = self.client_get(result["Location"])
- self.assert_in_response("check your email", result)
-
- # Visit the confirmation link.
- confirmation_url = self.get_confirmation_url_from_outbox(email)
- result = self.client_get(confirmation_url)
- self.assertEqual(result.status_code, 200)
-
with self.settings(PASSWORD_MIN_LENGTH=6, PASSWORD_MIN_GUESSES=1000):
- result = self.client_post(
- "/accounts/register/",
- {
- "password": "easy",
- "key": find_key_by_email(email),
- "terms": True,
- "full_name": "New Guy",
- "from_confirmation": "1",
- },
- )
- self.assert_in_success_response(
- ["Enter your account details to complete registration."], result
- )
-
- result = self.submit_reg_form_for_user(email, "easy", full_name="New Guy")
+ result = self.verify_signup(email=email, password="easy")
+ # _WSGIPatchedWSGIResponse does not exist in Django, thus the inverted isinstance check.
+ assert not isinstance(result, UserProfile)
self.assert_in_success_response(["The password is too weak."], result)
with self.assertRaises(UserProfile.DoesNotExist):
# Account wasn't created.