From b3cb59b07fd2b9190ae55aa453aa829bedf2127b Mon Sep 17 00:00:00 2001 From: Jawayria Date: Wed, 1 Sep 2021 19:27:33 +0500 Subject: [PATCH] fix: Replaced ''' with ''' to prevent test_reset_password_email from failing on Django 3 --- .../djangoapps/user_authn/views/tests/test_reset_password.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py b/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py index 941da555d0..89f273e651 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py @@ -9,6 +9,7 @@ import unittest from datetime import datetime, timedelta from unittest.mock import Mock, patch import ddt +import django from django.conf import settings from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX, make_password from django.contrib.auth.models import AnonymousUser, User # lint-amnesty, pylint: disable=imported-auth-user @@ -283,6 +284,9 @@ class ResetPasswordTests(EventTestMixin, CacheIsolationTestCase): body = bodies[body_type] + if django.VERSION >= (3, 0): + expected_output = "You're receiving this e-mail because you requested a password reset" + assert 'Password reset' in sent_message.subject assert expected_output in body assert sent_message.from_email == from_email