Merge pull request #15773 from edx/private_to_public_d28b140

Mergeback PR from private to public.
This commit is contained in:
edx-pipeline-bot
2017-08-08 17:19:12 -04:00
committed by GitHub
6 changed files with 27 additions and 41 deletions

View File

@@ -366,7 +366,7 @@ def activate_account(activation_key):
@helpers.intercept_errors(errors.UserAPIInternalError, ignore_errors=[errors.UserAPIRequestError])
def request_password_change(email, orig_host, is_secure):
def request_password_change(email, is_secure):
"""Email a single-use link for performing a password reset.
Users must confirm the password change before we update their information.
@@ -395,7 +395,6 @@ def request_password_change(email, orig_host, is_secure):
# and email it to the user.
form.save(
from_email=configuration_helpers.get_value('email_from_address', settings.DEFAULT_FROM_EMAIL),
domain_override=orig_host,
use_https=is_secure
)
else:

View File

@@ -320,7 +320,6 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
PASSWORD = u'ṕáśśẃőŕd'
EMAIL = u'frank+underwood@example.com'
ORIG_HOST = 'example.com'
IS_SECURE = False
@skip_unless_lms
@@ -390,7 +389,7 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
activate_account(activation_key)
# Request a password change
request_password_change(self.EMAIL, self.ORIG_HOST, self.IS_SECURE)
request_password_change(self.EMAIL, self.IS_SECURE)
# Verify that one email message has been sent
self.assertEqual(len(mail.outbox), 1)
@@ -404,7 +403,7 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
@skip_unless_lms
def test_request_password_change_invalid_user(self):
with self.assertRaises(UserNotFound):
request_password_change(self.EMAIL, self.ORIG_HOST, self.IS_SECURE)
request_password_change(self.EMAIL, self.IS_SECURE)
# Verify that no email messages have been sent
self.assertEqual(len(mail.outbox), 0)
@@ -414,7 +413,7 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
# Create an account, but do not activate it
create_account(self.USERNAME, self.PASSWORD, self.EMAIL)
request_password_change(self.EMAIL, self.ORIG_HOST, self.IS_SECURE)
request_password_change(self.EMAIL, self.IS_SECURE)
# Verify that the activation email was still sent
self.assertEqual(len(mail.outbox), 1)