summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_views.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auth_tests/test_views.py')
-rw-r--r--tests/auth_tests/test_views.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/auth_tests/test_views.py b/tests/auth_tests/test_views.py
index e6419de8e6..0a4f7d28c8 100644
--- a/tests/auth_tests/test_views.py
+++ b/tests/auth_tests/test_views.py
@@ -153,8 +153,8 @@ class PasswordResetTest(AuthViewsTestCase):
self.assertEqual(len(mail.outbox), 1)
self.assertIn("http://", mail.outbox[0].body)
self.assertEqual(settings.DEFAULT_FROM_EMAIL, mail.outbox[0].from_email)
- # optional multipart text/html email has been added. Make sure original,
- # default functionality is 100% the same
+ # optional multipart text/html email has been added. Make sure
+ # original, default functionality is 100% the same
self.assertFalse(mail.outbox[0].message().is_multipart())
def test_extra_email_context(self):
@@ -209,8 +209,8 @@ class PasswordResetTest(AuthViewsTestCase):
# the colon is interpreted as part of a username for login purposes,
# making 'evil.com' the request domain. Since HTTP_HOST is used to
# produce a meaningful reset URL, we need to be certain that the
- # HTTP_HOST header isn't poisoned. This is done as a check when get_host()
- # is invoked, but we check here as a practical consequence.
+ # HTTP_HOST header isn't poisoned. This is done as a check when
+ # get_host() is invoked, but we check here as a practical consequence.
with self.assertLogs("django.security.DisallowedHost", "ERROR"):
response = self.client.post(
"/password_reset/",
@@ -223,7 +223,10 @@ class PasswordResetTest(AuthViewsTestCase):
# Skip any 500 handler action (like sending more mail...)
@override_settings(DEBUG_PROPAGATE_EXCEPTIONS=True)
def test_poisoned_http_host_admin_site(self):
- "Poisoned HTTP_HOST headers can't be used for reset emails on admin views"
+ """
+ Poisoned HTTP_HOST headers can't be used for reset emails on admin
+ views
+ """
with self.assertLogs("django.security.DisallowedHost", "ERROR"):
response = self.client.post(
"/admin_password_reset/",
@@ -733,7 +736,8 @@ class SessionAuthenticationTests(AuthViewsTestCase):
def test_user_password_change_updates_session(self):
"""
#21649 - Ensure contrib.auth.views.password_change updates the user's
- session auth hash after a password change so the session isn't logged out.
+ session auth hash after a password change so the session isn't logged
+ out.
"""
self.login()
original_session_key = self.client.session.session_key
@@ -901,8 +905,8 @@ class LoginTest(AuthViewsTestCase):
def test_session_key_flushed_on_login(self):
"""
To avoid reusing another user's session, ensure a new, empty session is
- created if the existing session corresponds to a different authenticated
- user.
+ created if the existing session corresponds to a different
+ authenticated user.
"""
self.login()
original_session_key = self.client.session.session_key