1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed E128 flake8 warnings in tests/.

This commit is contained in:
Tim Graham
2016-04-07 22:04:45 -04:00
parent df8d8d4292
commit 92053acbb9
148 changed files with 2073 additions and 2248 deletions

View File

@@ -552,8 +552,10 @@ class FileSessionTests(SessionTestsMixin, unittest.TestCase):
file_prefix = settings.SESSION_COOKIE_NAME
def count_sessions():
return len([session_file for session_file in os.listdir(storage_path)
if session_file.startswith(file_prefix)])
return len([
session_file for session_file in os.listdir(storage_path)
if session_file.startswith(file_prefix)
])
self.assertEqual(0, count_sessions())
@@ -651,8 +653,10 @@ class SessionMiddlewareTests(TestCase):
response = middleware.process_response(request, response)
self.assertTrue(
response.cookies[settings.SESSION_COOKIE_NAME]['httponly'])
self.assertIn(http_cookies.Morsel._reserved['httponly'],
str(response.cookies[settings.SESSION_COOKIE_NAME]))
self.assertIn(
http_cookies.Morsel._reserved['httponly'],
str(response.cookies[settings.SESSION_COOKIE_NAME])
)
@override_settings(SESSION_COOKIE_HTTPONLY=False)
def test_no_httponly_session_cookie(self):