1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fix all violators of E231

This commit is contained in:
Alex Gaynor
2013-10-26 12:15:03 -07:00
parent f2d8027c9a
commit 9d740eb8b1
74 changed files with 628 additions and 629 deletions

View File

@@ -237,7 +237,7 @@ class AssertTemplateUsedTests(TestCase):
'email': 'foo@example.com',
'value': 37,
'single': 'b',
'multi': ('b','c','e')
'multi': ('b', 'c', 'e')
}
response = self.client.post('/test_client/form_view_with_template/', post_data)
self.assertContains(response, 'POST data OK')
@@ -439,7 +439,7 @@ class AssertFormErrorTests(TestCase):
'email': 'not an email address',
'value': 37,
'single': 'b',
'multi': ('b','c','e')
'multi': ('b', 'c', 'e')
}
response = self.client.post('/test_client/form_view/', post_data)
self.assertEqual(response.status_code, 200)
@@ -461,7 +461,7 @@ class AssertFormErrorTests(TestCase):
'email': 'not an email address',
'value': 37,
'single': 'b',
'multi': ('b','c','e')
'multi': ('b', 'c', 'e')
}
response = self.client.post('/test_client/form_view/', post_data)
self.assertEqual(response.status_code, 200)
@@ -483,7 +483,7 @@ class AssertFormErrorTests(TestCase):
'email': 'not an email address',
'value': 37,
'single': 'b',
'multi': ('b','c','e')
'multi': ('b', 'c', 'e')
}
response = self.client.post('/test_client/form_view/', post_data)
self.assertEqual(response.status_code, 200)
@@ -505,7 +505,7 @@ class AssertFormErrorTests(TestCase):
'email': 'not an email address',
'value': 37,
'single': 'b',
'multi': ('b','c','e')
'multi': ('b', 'c', 'e')
}
response = self.client.post('/test_client/form_view/', post_data)
self.assertEqual(response.status_code, 200)
@@ -530,7 +530,7 @@ class AssertFormErrorTests(TestCase):
'email': 'not an email address',
'value': 37,
'single': 'b',
'multi': ('b','c','e')
'multi': ('b', 'c', 'e')
}
response = self.client.post('/test_client/form_view/', post_data)
self.assertEqual(response.status_code, 200)
@@ -558,12 +558,12 @@ class AssertFormsetErrorTests(TestCase):
'form-0-email': 'not an email address',
'form-0-value': 37,
'form-0-single': 'b',
'form-0-multi': ('b','c','e'),
'form-0-multi': ('b', 'c', 'e'),
'form-1-text': 'Hello World',
'form-1-email': 'email@domain.com',
'form-1-value': 37,
'form-1-single': 'b',
'form-1-multi': ('b','c','e'),
'form-1-multi': ('b', 'c', 'e'),
})
# For testing non-form errors
self.response_nonform_errors = self.getResponse({
@@ -573,12 +573,12 @@ class AssertFormsetErrorTests(TestCase):
'form-0-email': 'email@domain.com',
'form-0-value': 37,
'form-0-single': 'b',
'form-0-multi': ('b','c','e'),
'form-0-multi': ('b', 'c', 'e'),
'form-1-text': 'Hello World',
'form-1-email': 'email@domain.com',
'form-1-value': 37,
'form-1-single': 'b',
'form-1-multi': ('b','c','e'),
'form-1-multi': ('b', 'c', 'e'),
})
def getResponse(self, post_data):
@@ -808,7 +808,7 @@ class ExceptionTests(TestCase):
def test_exception_cleared(self):
"#5836 - A stale user exception isn't re-raised by the test client."
login = self.client.login(username='testclient',password='password')
login = self.client.login(username='testclient', password='password')
self.assertTrue(login, 'Could not log in')
try:
self.client.get("/test_client_regress/staff_only/")
@@ -871,7 +871,7 @@ class ContextTests(TestCase):
def test_single_context(self):
"Context variables can be retrieved from a single context"
response = self.client.get("/test_client_regress/request_data/", data={'foo':'whiz'})
response = self.client.get("/test_client_regress/request_data/", data={'foo': 'whiz'})
self.assertEqual(response.context.__class__, Context)
self.assertTrue('get-foo' in response.context)
self.assertEqual(response.context['get-foo'], 'whiz')
@@ -886,7 +886,7 @@ class ContextTests(TestCase):
def test_inherited_context(self):
"Context variables can be retrieved from a list of contexts"
response = self.client.get("/test_client_regress/request_data_extended/", data={'foo':'whiz'})
response = self.client.get("/test_client_regress/request_data_extended/", data={'foo': 'whiz'})
self.assertEqual(response.context.__class__, ContextList)
self.assertEqual(len(response.context), 2)
self.assertTrue('get-foo' in response.context)
@@ -957,7 +957,7 @@ class SessionTests(TestCase):
self.assertEqual(response.content, b'YES')
# Log in
login = self.client.login(username='testclient',password='password')
login = self.client.login(username='testclient', password='password')
self.assertTrue(login, 'Could not log in')
# Session should still contain the modified value
@@ -968,7 +968,7 @@ class SessionTests(TestCase):
def test_logout(self):
"""Logout should work whether the user is logged in or not (#9978)."""
self.client.logout()
login = self.client.login(username='testclient',password='password')
login = self.client.login(username='testclient', password='password')
self.assertTrue(login, 'Could not log in')
self.client.logout()
self.client.logout()
@@ -1120,7 +1120,7 @@ class QueryStringTests(TestCase):
for method_name in ('get', 'head'):
# A GET-like request can pass a query string as data
method = getattr(self.client, method_name)
response = method("/test_client_regress/request_data/", data={'foo':'whiz'})
response = method("/test_client_regress/request_data/", data={'foo': 'whiz'})
self.assertEqual(response.context['get-foo'], 'whiz')
self.assertEqual(response.context['request-foo'], 'whiz')
@@ -1130,11 +1130,11 @@ class QueryStringTests(TestCase):
self.assertEqual(response.context['request-foo'], 'whiz')
# Data provided in the URL to a GET-like request is overridden by actual form data
response = method("/test_client_regress/request_data/?foo=whiz", data={'foo':'bang'})
response = method("/test_client_regress/request_data/?foo=whiz", data={'foo': 'bang'})
self.assertEqual(response.context['get-foo'], 'bang')
self.assertEqual(response.context['request-foo'], 'bang')
response = method("/test_client_regress/request_data/?foo=whiz", data={'bar':'bang'})
response = method("/test_client_regress/request_data/?foo=whiz", data={'bar': 'bang'})
self.assertEqual(response.context['get-foo'], None)
self.assertEqual(response.context['get-bar'], 'bang')
self.assertEqual(response.context['request-foo'], None)
@@ -1142,7 +1142,7 @@ class QueryStringTests(TestCase):
def test_post_like_requests(self):
# A POST-like request can pass a query string as data
response = self.client.post("/test_client_regress/request_data/", data={'foo':'whiz'})
response = self.client.post("/test_client_regress/request_data/", data={'foo': 'whiz'})
self.assertEqual(response.context['get-foo'], None)
self.assertEqual(response.context['post-foo'], 'whiz')
@@ -1153,12 +1153,12 @@ class QueryStringTests(TestCase):
self.assertEqual(response.context['request-foo'], 'whiz')
# POST data provided in the URL augments actual form data
response = self.client.post("/test_client_regress/request_data/?foo=whiz", data={'foo':'bang'})
response = self.client.post("/test_client_regress/request_data/?foo=whiz", data={'foo': 'bang'})
self.assertEqual(response.context['get-foo'], 'whiz')
self.assertEqual(response.context['post-foo'], 'bang')
self.assertEqual(response.context['request-foo'], 'bang')
response = self.client.post("/test_client_regress/request_data/?foo=whiz", data={'bar':'bang'})
response = self.client.post("/test_client_regress/request_data/?foo=whiz", data={'bar': 'bang'})
self.assertEqual(response.context['get-foo'], 'whiz')
self.assertEqual(response.context['get-bar'], None)
self.assertEqual(response.context['post-foo'], None)