Permalink
Browse files

Fixed #21287 -- Fixed E123 pep8 warnings

  • Loading branch information...
1 parent 65750b8 commit a800036981c6fea8eb3dac22467965c71af05d29 @alasdairnicol alasdairnicol committed Oct 18, 2013
Showing with 152 additions and 152 deletions.
  1. +2 −2 django/contrib/admin/filters.py
  2. +1 −1 django/contrib/admin/options.py
  3. +1 −1 django/contrib/auth/management/commands/changepassword.py
  4. +15 −15 django/contrib/auth/tests/test_forms.py
  5. +4 −4 django/contrib/auth/tests/test_views.py
  6. +1 −1 django/contrib/contenttypes/generic.py
  7. +12 −12 django/contrib/flatpages/tests/test_templatetags.py
  8. +2 −2 django/contrib/gis/db/backends/oracle/operations.py
  9. +2 −2 django/contrib/gis/db/backends/postgis/operations.py
  10. +2 −2 django/contrib/gis/db/backends/spatialite/operations.py
  11. +1 −1 django/contrib/gis/forms/fields.py
  12. +1 −1 django/contrib/gis/management/commands/ogrinspect.py
  13. +3 −3 django/contrib/gis/measure.py
  14. +1 −1 django/contrib/gis/tests/geo3d/tests.py
  15. +2 −2 django/contrib/gis/tests/geoadmin/tests.py
  16. +1 −1 django/contrib/gis/utils/layermapping.py
  17. +1 −1 django/contrib/messages/tests/base.py
  18. +1 −1 django/core/management/commands/loaddata.py
  19. +1 −1 django/core/management/templates.py
  20. +1 −1 django/db/utils.py
  21. +1 −1 django/forms/formsets.py
  22. +1 −1 django/forms/models.py
  23. +2 −2 django/http/request.py
  24. +1 −1 django/template/base.py
  25. +1 −1 django/test/html.py
  26. +1 −1 django/test/runner.py
  27. +1 −1 django/utils/crypto.py
  28. +2 −2 django/utils/jslex.py
  29. +2 −2 extras/csrf_migration_helper.py
  30. +1 −1 setup.cfg
  31. +1 −1 tests/admin_scripts/management/commands/custom_startproject.py
  32. +1 −1 tests/admin_views/models.py
  33. +3 −3 tests/admin_views/tests.py
  34. +1 −1 tests/aggregation_regress/tests.py
  35. +1 −1 tests/basic/tests.py
  36. +2 −2 tests/cache/tests.py
  37. +2 −2 tests/file_uploads/tests.py
  38. +2 −2 tests/fixtures_regress/tests.py
  39. +3 −3 tests/forms_tests/tests/test_fields.py
  40. +4 −4 tests/forms_tests/tests/test_formsets.py
  41. +1 −1 tests/forms_tests/tests/tests.py
  42. +4 −4 tests/generic_relations/tests.py
  43. +1 −1 tests/i18n/tests.py
  44. +6 −6 tests/logging_tests/tests.py
  45. +1 −1 tests/mail/tests.py
  46. +3 −3 tests/managers_regress/tests.py
  47. +4 −4 tests/middleware_exceptions/tests.py
  48. +2 −2 tests/model_fields/models.py
  49. +9 −9 tests/model_forms/tests.py
  50. +1 −1 tests/model_formsets_regress/tests.py
  51. +2 −2 tests/model_regress/tests.py
  52. +3 −3 tests/pagination/tests.py
  53. +2 −2 tests/prefetch_related/tests.py
  54. +1 −1 tests/requests/tests.py
  55. +1 −1 tests/runtests.py
  56. +1 −1 tests/select_for_update/tests.py
  57. +1 −1 tests/serializers_regress/tests.py
  58. +1 −1 tests/signing/tests.py
  59. +3 −3 tests/template_tests/templatetags/custom.py
  60. +1 −1 tests/template_tests/test_loaders.py
  61. +2 −2 tests/template_tests/test_parser.py
  62. +4 −4 tests/template_tests/test_response.py
  63. +1 −1 tests/template_tests/tests.py
  64. +1 −1 tests/test_runner/tests.py
  65. +1 −1 tests/utils_tests/test_html.py
  66. +1 −1 tests/utils_tests/test_jslex.py
  67. +2 −2 tests/validation/test_unique.py
  68. +1 −1 tests/view_tests/tests/test_static.py
  69. +1 −1 tests/view_tests/views.py
  70. +1 −1 tests/wsgi/tests.py
  71. +1 −1 tests/wsgi/urls.py
@@ -242,15 +242,15 @@ def choices(self, cl):
'selected': self.lookup_val == lookup and not self.lookup_val2,
'query_string': cl.get_query_string({
self.lookup_kwarg: lookup,
- }, [self.lookup_kwarg2]),
+ }, [self.lookup_kwarg2]),
'display': title,
}
if isinstance(self.field, models.NullBooleanField):
yield {
'selected': self.lookup_val2 == 'True',
'query_string': cl.get_query_string({
self.lookup_kwarg2: 'True',
- }, [self.lookup_kwarg]),
+ }, [self.lookup_kwarg]),
'display': _('Unknown'),
}
@@ -1200,7 +1200,7 @@ def response_delete(self, request, obj_display):
'The %(name)s "%(obj)s" was deleted successfully.') % {
'name': force_text(opts.verbose_name),
'obj': force_text(obj_display)
- }, messages.SUCCESS)
+ }, messages.SUCCESS)
if self.has_change_permission(request, None):
post_url = reverse('admin:%s_%s_changelist' %
@@ -35,7 +35,7 @@ def handle(self, *args, **options):
try:
u = UserModel._default_manager.using(options.get('database')).get(**{
UserModel.USERNAME_FIELD: username
- })
+ })
except UserModel.DoesNotExist:
raise CommandError("user '%s' does not exist" % username)
@@ -32,7 +32,7 @@ def test_user_already_exists(self):
'username': 'testclient',
'password1': 'test123',
'password2': 'test123',
- }
+ }
form = UserCreationForm(data)
self.assertFalse(form.is_valid())
self.assertEqual(form["username"].errors,
@@ -43,7 +43,7 @@ def test_invalid_data(self):
'username': 'jsmith!',
'password1': 'test123',
'password2': 'test123',
- }
+ }
form = UserCreationForm(data)
self.assertFalse(form.is_valid())
self.assertEqual(form["username"].errors,
@@ -55,7 +55,7 @@ def test_password_verification(self):
'username': 'jsmith',
'password1': 'test123',
'password2': 'test',
- }
+ }
form = UserCreationForm(data)
self.assertFalse(form.is_valid())
self.assertEqual(form["password2"].errors,
@@ -82,7 +82,7 @@ def test_success(self):
'username': 'jsmith@example.com',
'password1': 'test123',
'password2': 'test123',
- }
+ }
form = UserCreationForm(data)
self.assertTrue(form.is_valid())
u = form.save()
@@ -101,7 +101,7 @@ def test_invalid_username(self):
data = {
'username': 'jsmith_does_not_exist',
'password': 'test123',
- }
+ }
form = AuthenticationForm(None, data)
self.assertFalse(form.is_valid())
self.assertEqual(form.non_field_errors(),
@@ -114,7 +114,7 @@ def test_inactive_user(self):
data = {
'username': 'inactive',
'password': 'password',
- }
+ }
form = AuthenticationForm(None, data)
self.assertFalse(form.is_valid())
self.assertEqual(form.non_field_errors(),
@@ -126,7 +126,7 @@ def test_inactive_user_i18n(self):
data = {
'username': 'inactive',
'password': 'password',
- }
+ }
form = AuthenticationForm(None, data)
self.assertFalse(form.is_valid())
self.assertEqual(form.non_field_errors(),
@@ -137,7 +137,7 @@ def test_custom_login_allowed_policy(self):
data = {
'username': 'inactive',
'password': 'password',
- }
+ }
class AuthenticationFormWithInactiveUsersOkay(AuthenticationForm):
def confirm_login_allowed(self, user):
@@ -161,7 +161,7 @@ def confirm_login_allowed(self, user):
data = {
'username': 'testclient',
'password': 'password',
- }
+ }
form = PickyAuthenticationForm(None, data)
self.assertFalse(form.is_valid())
self.assertEqual(form.non_field_errors(), ["Sorry, nobody's allowed in."])
@@ -171,7 +171,7 @@ def test_success(self):
data = {
'username': 'testclient',
'password': 'password',
- }
+ }
form = AuthenticationForm(None, data)
self.assertTrue(form.is_valid())
self.assertEqual(form.non_field_errors(), [])
@@ -215,7 +215,7 @@ def test_password_verification(self):
data = {
'new_password1': 'abc123',
'new_password2': 'abc',
- }
+ }
form = SetPasswordForm(user, data)
self.assertFalse(form.is_valid())
self.assertEqual(form["new_password2"].errors,
@@ -226,7 +226,7 @@ def test_success(self):
data = {
'new_password1': 'abc123',
'new_password2': 'abc123',
- }
+ }
form = SetPasswordForm(user, data)
self.assertTrue(form.is_valid())
@@ -243,7 +243,7 @@ def test_incorrect_password(self):
'old_password': 'test',
'new_password1': 'abc123',
'new_password2': 'abc123',
- }
+ }
form = PasswordChangeForm(user, data)
self.assertFalse(form.is_valid())
self.assertEqual(form["old_password"].errors,
@@ -256,7 +256,7 @@ def test_password_verification(self):
'old_password': 'password',
'new_password1': 'abc123',
'new_password2': 'abc',
- }
+ }
form = PasswordChangeForm(user, data)
self.assertFalse(form.is_valid())
self.assertEqual(form["new_password2"].errors,
@@ -269,7 +269,7 @@ def test_success(self):
'old_password': 'password',
'new_password1': 'abc123',
'new_password2': 'abc123',
- }
+ }
form = PasswordChangeForm(user, data)
self.assertTrue(form.is_valid())
@@ -49,7 +49,7 @@ def login(self, password='password'):
response = self.client.post('/login/', {
'username': 'testclient',
'password': password,
- })
+ })
self.assertTrue(SESSION_KEY in self.client.session)
return response
@@ -180,7 +180,7 @@ def test_poisoned_http_host(self):
response = self.client.post('/password_reset/',
{'email': 'staffmember@example.com'},
HTTP_HOST='www.example:dr.frankenstein@evil.tld'
- )
+ )
self.assertEqual(response.status_code, 400)
self.assertEqual(len(mail.outbox), 0)
self.assertEqual(len(logger_calls), 1)
@@ -193,7 +193,7 @@ def test_poisoned_http_host_admin_site(self):
response = self.client.post('/admin_password_reset/',
{'email': 'staffmember@example.com'},
HTTP_HOST='www.example:dr.frankenstein@evil.tld'
- )
+ )
self.assertEqual(response.status_code, 400)
self.assertEqual(len(mail.outbox), 0)
self.assertEqual(len(logger_calls), 1)
@@ -357,7 +357,7 @@ def fail_login(self, password='password'):
})
self.assertFormError(response, AuthenticationForm.error_messages['invalid_login'] % {
'username': User._meta.get_field('username').verbose_name
- })
+ })
def logout(self):
self.client.get('/logout/')
@@ -354,7 +354,7 @@ def get_prefetch_queryset(self, instances):
'%s__pk' % self.content_type_field_name: self.content_type.id,
'%s__in' % self.object_id_field_name:
set(obj._get_pk_val() for obj in instances)
- }
+ }
qs = super(GenericRelatedObjectManager, self).get_queryset().using(db).filter(**query)
# We (possibly) need to convert object IDs to the type of the
# instances' PK in order to match up instances:
@@ -32,7 +32,7 @@ def test_get_flatpages_tag(self):
"{% for page in flatpages %}"
"{{ page.title }},"
"{% endfor %}"
- ).render(Context())
+ ).render(Context())
self.assertEqual(out, "A Flatpage,A Nested Flatpage,")
def test_get_flatpages_tag_for_anon_user(self):
@@ -43,9 +43,9 @@ def test_get_flatpages_tag_for_anon_user(self):
"{% for page in flatpages %}"
"{{ page.title }},"
"{% endfor %}"
- ).render(Context({
+ ).render(Context({
'anonuser': AnonymousUser()
- }))
+ }))
self.assertEqual(out, "A Flatpage,A Nested Flatpage,")
@skipIfCustomUser
@@ -58,9 +58,9 @@ def test_get_flatpages_tag_for_user(self):
"{% for page in flatpages %}"
"{{ page.title }},"
"{% endfor %}"
- ).render(Context({
+ ).render(Context({
'me': me
- }))
+ }))
self.assertEqual(out, "A Flatpage,A Nested Flatpage,Sekrit Nested Flatpage,Sekrit Flatpage,")
def test_get_flatpages_with_prefix(self):
@@ -71,7 +71,7 @@ def test_get_flatpages_with_prefix(self):
"{% for page in location_flatpages %}"
"{{ page.title }},"
"{% endfor %}"
- ).render(Context())
+ ).render(Context())
self.assertEqual(out, "A Nested Flatpage,")
def test_get_flatpages_with_prefix_for_anon_user(self):
@@ -82,9 +82,9 @@ def test_get_flatpages_with_prefix_for_anon_user(self):
"{% for page in location_flatpages %}"
"{{ page.title }},"
"{% endfor %}"
- ).render(Context({
+ ).render(Context({
'anonuser': AnonymousUser()
- }))
+ }))
self.assertEqual(out, "A Nested Flatpage,")
@skipIfCustomUser
@@ -97,9 +97,9 @@ def test_get_flatpages_with_prefix_for_user(self):
"{% for page in location_flatpages %}"
"{{ page.title }},"
"{% endfor %}"
- ).render(Context({
+ ).render(Context({
'me': me
- }))
+ }))
self.assertEqual(out, "A Nested Flatpage,Sekrit Nested Flatpage,")
def test_get_flatpages_with_variable_prefix(self):
@@ -110,9 +110,9 @@ def test_get_flatpages_with_variable_prefix(self):
"{% for page in location_flatpages %}"
"{{ page.title }},"
"{% endfor %}"
- ).render(Context({
+ ).render(Context({
'location_prefix': '/location/'
- }))
+ }))
self.assertEqual(out, "A Nested Flatpage,")
def test_parsing_errors(self):
@@ -114,7 +114,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
'distance_lt' : (SDODistance('<'), dtypes),
'distance_lte' : (SDODistance('<='), dtypes),
'dwithin' : (SDODWithin(), dtypes),
- }
+ }
geometry_functions = {
'contains' : SDOOperation('SDO_CONTAINS'),
@@ -129,7 +129,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
'relate' : (SDORelate, six.string_types), # Oracle uses a different syntax, e.g., 'mask=inside+touch'
'touches' : SDOOperation('SDO_TOUCH'),
'within' : SDOOperation('SDO_INSIDE'),
- }
+ }
geometry_functions.update(distance_functions)
gis_terms = set(['isnull'])
@@ -119,7 +119,7 @@ def __init__(self, connection):
# The "&&" operator returns true if A's bounding box overlaps
# B's bounding box.
'bboverlaps' : PostGISOperator('&&'),
- }
+ }
self.geometry_functions = {
'equals' : PostGISFunction(prefix, 'Equals'),
@@ -256,7 +256,7 @@ def spatial_version(self):
'GeoDjango requires at least PostGIS version 1.3. '
'Was the database created from a spatial database '
'template?' % self.connection.settings_dict['NAME']
- )
+ )
version = vtup[1:]
return version
@@ -103,14 +103,14 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
# These are implemented here as synonyms for Equals
'same_as' : SpatiaLiteFunction('Equals'),
'exact' : SpatiaLiteFunction('Equals'),
- }
+ }
distance_functions = {
'distance_gt' : (get_dist_ops('>'), dtypes),
'distance_gte' : (get_dist_ops('>='), dtypes),
'distance_lt' : (get_dist_ops('<'), dtypes),
'distance_lte' : (get_dist_ops('<='), dtypes),
- }
+ }
geometry_functions.update(distance_functions)
def __init__(self, connection):
@@ -24,7 +24,7 @@ class GeometryField(forms.Field):
'invalid_geom_type' : _('Invalid geometry type.'),
'transform_error' : _('An error occurred when transforming the geometry '
'to the SRID of the geometry form field.'),
- }
+ }
def __init__(self, **kwargs):
# Pop out attributes from the database field, or use sensible
@@ -67,7 +67,7 @@ class Command(LabelCommand):
'determined, the SRID of the data source is used.'),
make_option('--mapping', action='store_true', dest='mapping',
help='Generate mapping dictionary for use with `LayerMapping`.')
- )
+ )
requires_model_validation = False
@@ -252,7 +252,7 @@ class Distance(MeasureBase):
'survey_ft' : 0.304800609601,
'um' : 0.000001,
'yd': 0.9144,
- }
+ }
# Unit aliases for `UNIT` terms encountered in Spatial Reference WKT.
ALIAS = {
@@ -292,7 +292,7 @@ class Distance(MeasureBase):
'U.S. Foot' : 'survey_ft',
'Yard (Indian)' : 'indian_yd',
'Yard (Sears)' : 'sears_yd'
- }
+ }
LALIAS = dict((k.lower(), v) for k, v in ALIAS.items())
def __mul__(self, other):
@@ -305,7 +305,7 @@ def __mul__(self, other):
else:
raise TypeError('%(distance)s must be multiplied with number or %(distance)s' % {
"distance" : pretty_name(self.__class__),
- })
+ })
class Area(MeasureBase):
Oops, something went wrong.

0 comments on commit a800036

Please sign in to comment.