emails: Make it obvious when registering creates new realm.

Checked the email looked OK in `/emails` for both creating realm and
registering within an existing one.

Not sure zerver/tests/test_i18n.py test has been suppressed correctly.

Fixes #17786.
This commit is contained in:
Gilbert Bishop-White
2021-05-26 18:40:12 +01:00
committed by Tim Abbott
parent bf179b7d2f
commit e4d9e58c7d
6 changed files with 41 additions and 4 deletions

View File

@@ -649,6 +649,8 @@ Output:
email_address: str,
*,
url_pattern: Optional[str] = None,
email_subject_contains: Optional[str] = None,
email_body_contains: Optional[str] = None,
) -> str:
from django.core.mail import outbox
@@ -661,6 +663,13 @@ Output:
):
match = re.search(url_pattern, message.body)
assert match is not None
if email_subject_contains:
self.assertIn(email_subject_contains, message.subject)
if email_body_contains:
self.assertIn(email_body_contains, message.body)
[confirmation_url] = match.groups()
return confirmation_url
else: