Use platform_name instead of site_name in password reset email
This commit is contained in:
committed by
Omar Al-Ithawi
parent
e6c94400d1
commit
4f6eaa59d1
@@ -185,18 +185,22 @@ class ResetPasswordTests(EventTestMixin, CacheIsolationTestCase):
|
||||
req = self.request_factory.post(
|
||||
'/password_reset/', {'email': self.user.email}
|
||||
)
|
||||
req.is_secure = Mock(return_value=True)
|
||||
req.get_host = Mock(return_value=domain_override)
|
||||
req.user = self.user
|
||||
password_reset(req)
|
||||
_, msg, _, _ = send_email.call_args[0]
|
||||
|
||||
reset_msg = "you requested a password reset for your user account at {}"
|
||||
if domain_override:
|
||||
reset_msg = reset_msg.format(domain_override)
|
||||
else:
|
||||
reset_msg = reset_msg.format(settings.SITE_NAME)
|
||||
reset_intro_msg = "you requested a password reset for your user account at {}".format(platform_name)
|
||||
self.assertIn(reset_intro_msg, msg)
|
||||
|
||||
self.assertIn(reset_msg, msg)
|
||||
reset_link = "https://{}/"
|
||||
if domain_override:
|
||||
reset_link = reset_link.format(domain_override)
|
||||
else:
|
||||
reset_link = reset_link.format(settings.SITE_NAME)
|
||||
|
||||
self.assertIn(reset_link, msg)
|
||||
|
||||
sign_off = "The {} Team".format(platform_name)
|
||||
self.assertIn(sign_off, msg)
|
||||
@@ -221,7 +225,7 @@ class ResetPasswordTests(EventTestMixin, CacheIsolationTestCase):
|
||||
password_reset(req)
|
||||
_, msg, from_addr, _ = send_email.call_args[0]
|
||||
|
||||
reset_msg = "you requested a password reset for your user account at openedx.localhost"
|
||||
reset_msg = "you requested a password reset for your user account at {}".format(fake_get_value('platform_name'))
|
||||
|
||||
self.assertIn(reset_msg, msg)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% load i18n %}{% autoescape off %}
|
||||
{% blocktrans %}You're receiving this e-mail because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
|
||||
{% blocktrans %}You're receiving this e-mail because you requested a password reset for your user account at {{ platform_name }}.{% endblocktrans %}
|
||||
|
||||
{% trans "Please go to the following page and choose a new password:" %}
|
||||
{% block reset_link %}
|
||||
|
||||
Reference in New Issue
Block a user