Commit 4f6eaa59 by Salah Alomari Committed by Omar Al-Ithawi

Use platform_name instead of site_name in password reset email

parent e6c94400
......@@ -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 {}"
reset_intro_msg = "you requested a password reset for your user account at {}".format(platform_name)
self.assertIn(reset_intro_msg, msg)
reset_link = "https://{}/"
if domain_override:
reset_msg = reset_msg.format(domain_override)
reset_link = reset_link.format(domain_override)
else:
reset_msg = reset_msg.format(settings.SITE_NAME)
reset_link = reset_link.format(settings.SITE_NAME)
self.assertIn(reset_msg, msg)
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)
......
{% 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 %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment