From a51bf96c705a4a14f8c9ae81abdce9a95cf6e2d6 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Thu, 19 Jan 2023 11:56:45 +0000 Subject: [PATCH] accounts_send_confirm: Show email to which the link was sent. This can be useful for the user in case user is worried if they typed the correct email. --- templates/zerver/accounts_send_confirm.html | 2 +- zerver/tests/test_signup.py | 60 ++++++++++----------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/templates/zerver/accounts_send_confirm.html b/templates/zerver/accounts_send_confirm.html index 76ba494880..2526f48cbb 100644 --- a/templates/zerver/accounts_send_confirm.html +++ b/templates/zerver/accounts_send_confirm.html @@ -18,7 +18,7 @@ page can be easily identified in it's respective JavaScript file -->
-

{{ _("Check your email so we can get started.") }}

+

{% trans %}Check your email ({{ email }}) so we can get started.{% endtrans %}

{% include 'zerver/dev_env_email_access_details.html' %} diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py index 3fe48726ee..aabaaff159 100644 --- a/zerver/tests/test_signup.py +++ b/zerver/tests/test_signup.py @@ -3024,7 +3024,7 @@ class MultiuseInviteTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) confirmation_url = self.get_confirmation_url_from_outbox(email) result = self.client_get(confirmation_url) @@ -3398,7 +3398,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Check confirmation email has the correct subject and body, extract # confirmation link and visit it @@ -3509,7 +3509,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -3549,7 +3549,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -3592,7 +3592,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -3646,7 +3646,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -3685,7 +3685,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -3720,7 +3720,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -3758,7 +3758,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) confirmation_url = self.get_confirmation_url_from_outbox(email) result = self.client_get(confirmation_url) @@ -3806,7 +3806,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) first_confirmation_url = self.get_confirmation_url_from_outbox(email) self.assertEqual(PreregistrationUser.objects.filter(email=email, status=0).count(), 1) @@ -3815,7 +3815,7 @@ class RealmCreationTest(ZulipTestCase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/new/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) second_confirmation_url = self.get_confirmation_url_from_outbox(email) self.assertNotEqual(first_confirmation_url, second_confirmation_url) @@ -4074,7 +4074,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"], **client_kwargs) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -4151,7 +4151,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -4182,7 +4182,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -4216,7 +4216,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -4309,7 +4309,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) from django.core.mail import outbox @@ -4327,7 +4327,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -4357,7 +4357,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -4628,7 +4628,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. confirmation_url = self.get_confirmation_url_from_outbox(email) @@ -4819,7 +4819,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. from django.core.mail import outbox @@ -4902,7 +4902,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. from django.core.mail import outbox @@ -4977,7 +4977,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) with self.settings( POPULATE_PROFILE_VIA_LDAP=True, @@ -5044,7 +5044,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) with self.settings( POPULATE_PROFILE_VIA_LDAP=True, @@ -5190,7 +5190,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) with self.settings( POPULATE_PROFILE_VIA_LDAP=True, @@ -5241,7 +5241,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # If the user's email is inside the LDAP directory and we just # have a wrong password, then we refuse to create an account @@ -5363,7 +5363,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) with self.settings( POPULATE_PROFILE_VIA_LDAP=True, @@ -5404,7 +5404,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) with self.settings( POPULATE_PROFILE_VIA_LDAP=True, LDAP_EMAIL_ATTR="mail", @@ -5555,7 +5555,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) with patch("zerver.views.registration.name_changes_disabled", return_value=True): result = self.submit_reg_form_for_user( @@ -5584,7 +5584,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"]) - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. from django.core.mail import outbox @@ -5645,7 +5645,7 @@ class UserSignUpTest(InviteUserBase): self.assertEqual(result.status_code, 302) self.assertTrue(result["Location"].endswith(f"/accounts/send_confirm/{email}")) result = self.client_get(result["Location"], subdomain="zephyr") - self.assert_in_response("Check your email so we can get started.", result) + self.assert_in_response("Check your email", result) # Visit the confirmation link. from django.core.mail import outbox