Merge pull request #28613 from edx/jawayria/bom-2773

fix: Replaced '&#39' with '&#x27' to prevent tests from failing on Django 3
This commit is contained in:
Jawayria
2021-09-07 18:34:05 +05:00
committed by GitHub

View File

@@ -9,6 +9,7 @@ import unittest
from datetime import datetime, timedelta from datetime import datetime, timedelta
from unittest.mock import Mock, patch from unittest.mock import Mock, patch
import ddt import ddt
import django
from django.conf import settings from django.conf import settings
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX, make_password 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 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] 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 'Password reset' in sent_message.subject
assert expected_output in body assert expected_output in body
assert sent_message.from_email == from_email assert sent_message.from_email == from_email