Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1852 from jasonamyers/cleanup/PEP8

Cleanup/pep8 tests
  • Loading branch information...
commit 7288e1b02b2504b1694fe14df2d81e6a354c5610 2 parents 91078f5 + 4f151da
Alex Gaynor authored November 03, 2013

Showing 241 changed files with 1,631 additions and 290 deletions. Show diff stats Hide diff stats

  1. 3  django/forms/widgets.py
  2. 2  setup.cfg
  3. 15  tests/admin_changelist/models.py
  4. 2  tests/admin_custom_urls/models.py
  5. 2  tests/admin_docs/views.py
  6. 1  tests/admin_filters/models.py
  7. 3  tests/admin_inlines/admin.py
  8. 21  tests/admin_inlines/models.py
  9. 24  tests/admin_inlines/tests.py
  10. 4  tests/admin_ordering/models.py
  11. 1  tests/admin_ordering/tests.py
  12. 9  tests/admin_scripts/tests.py
  13. 5  tests/admin_util/models.py
  14. 6  tests/admin_util/tests.py
  15. 3  tests/admin_validation/tests.py
  16. 22  tests/admin_views/admin.py
  17. 22  tests/admin_views/models.py
  18. 35  tests/admin_views/tests.py
  19. 1  tests/admin_views/views.py
  20. 14  tests/admin_widgets/models.py
  21. 16  tests/admin_widgets/tests.py
  22. 3  tests/aggregation/models.py
  23. 6  tests/aggregation_regress/models.py
  24. 18  tests/backends/tests.py
  25. 2  tests/basic/models.py
  26. 48  tests/basic/tests.py
  27. 2  tests/bug639/models.py
  28. 5  tests/bulk_create/models.py
  29. 1  tests/cache/closeable_cache.py
  30. 1  tests/cache/liberal_backend.py
  31. 1  tests/cache/models.py
  32. 6  tests/cache/tests.py
  33. 2  tests/check/models.py
  34. 1  tests/check/tests.py
  35. 1  tests/choices/models.py
  36. 1  tests/commands_sql/tests.py
  37. 1  tests/conditional_processing/tests.py
  38. 4  tests/conditional_processing/views.py
  39. 2  tests/contenttypes_tests/models.py
  40. 1  tests/contenttypes_tests/tests.py
  41. 5  tests/csrf_tests/tests.py
  42. 1  tests/custom_columns/models.py
  43. 1  tests/custom_columns_regress/models.py
  44. 1  tests/custom_columns_regress/tests.py
  45. 10  tests/custom_managers/models.py
  46. 3  tests/custom_managers_regress/models.py
  47. 1  tests/custom_pk/fields.py
  48. 4  tests/custom_pk/models.py
  49. 1  tests/datatypes/models.py
  50. 2  tests/dates/models.py
  51. 2  tests/datetimes/models.py
  52. 1  tests/db_typecasts/tests.py
  53. 3  tests/decorators/tests.py
  54. 4  tests/defer/models.py
  55. 14  tests/defer_regress/models.py
  56. 1  tests/defer_regress/tests.py
  57. 6  tests/delete/models.py
  58. 3  tests/delete/tests.py
  59. 28  tests/delete_regress/models.py
  60. 3  tests/delete_regress/tests.py
  61. 8  tests/dispatch/tests/test_dispatcher.py
  62. 4  tests/dispatch/tests/test_saferef.py
  63. 5  tests/distinct_on_fields/models.py
  64. 3  tests/distinct_on_fields/tests.py
  65. 1  tests/expressions/models.py
  66. 1  tests/expressions_regress/models.py
  67. 70  tests/expressions_regress/tests.py
  68. 2  tests/extra_regress/models.py
  69. 2  tests/field_subclassing/fields.py
  70. 2  tests/field_subclassing/models.py
  71. 1  tests/file_storage/models.py
  72. 5  tests/file_storage/tests.py
  73. 3  tests/file_uploads/tests.py
  74. 4  tests/file_uploads/uploadhandler.py
  75. 10  tests/file_uploads/views.py
  76. 8  tests/fixtures/models.py
  77. 1  tests/fixtures_model_package/models/__init__.py
  78. 1  tests/fixtures_regress/models.py
  79. 4  tests/force_insert_update/models.py
  80. 11  tests/foreign_object/models.py
  81. 2  tests/foreign_object/tests.py
  82. 5  tests/forms_tests/models.py
  83. 1  tests/forms_tests/tests/test_error_messages.py
  84. 3  tests/forms_tests/tests/test_extra.py
  85. 6  tests/forms_tests/tests/test_formsets.py
  86. 2  tests/forms_tests/tests/test_input_formats.py
  87. 4  tests/forms_tests/tests/test_widgets.py
  88. 1  tests/forms_tests/tests/tests.py
  89. 1  tests/generic_inline_admin/admin.py
  90. 2  tests/generic_inline_admin/models.py
  91. 3  tests/generic_inline_admin/tests.py
  92. 2  tests/generic_relations/tests.py
  93. 25  tests/generic_relations_regress/models.py
  94. 4  tests/generic_views/models.py
  95. 1  tests/generic_views/test_base.py
  96. 3  tests/generic_views/test_dates.py
  97. 19  tests/generic_views/views.py
  98. 2  tests/get_object_or_404/models.py
  99. 2  tests/get_or_create_regress/models.py
  100. 5  tests/handlers/views.py
  101. 5  tests/httpwrappers/tests.py
  102. 2  tests/i18n/forms.py
  103. 1  tests/i18n/models.py
  104. 18  tests/i18n/test_extraction.py
  105. 3  tests/i18n/tests.py
  106. 4  tests/inline_formsets/models.py
  107. 6  tests/inspectdb/models.py
  108. 3  tests/inspectdb/tests.py
  109. 4  tests/known_related_objects/models.py
  110. 1  tests/known_related_objects/tests.py
  111. 2  tests/logging_tests/tests.py
  112. 5  tests/lookup/models.py
  113. 2  tests/m2m_and_m2o/models.py
  114. 3  tests/m2m_and_m2o/tests.py
  115. 2  tests/m2m_intermediary/models.py
  116. 9  tests/m2m_regress/models.py
  117. 3  tests/m2m_signals/models.py
  118. 6  tests/m2m_through/models.py
  119. 9  tests/m2m_through_regress/models.py
  120. 1  tests/m2o_recursive/models.py
  121. 1  tests/m2o_recursive/tests.py
  122. 1  tests/many_to_many/models.py
  123. 1  tests/many_to_one/models.py
  124. 1  tests/many_to_one_null/models.py
  125. 11  tests/many_to_one_regress/models.py
  126. 1  tests/max_lengths/models.py
  127. 1  tests/max_lengths/tests.py
  128. 12  tests/middleware/tests.py
  129. 2  tests/middleware_exceptions/tests.py
  130. 6  tests/middleware_exceptions/views.py
  131. 8  tests/model_fields/tests.py
  132. 28  tests/model_forms/models.py
  133. 11  tests/model_forms/tests.py
  134. 12  tests/model_forms_regress/models.py
  135. 7  tests/model_forms_regress/tests.py
  136. 26  tests/model_formsets/models.py
  137. 6  tests/model_formsets_regress/models.py
  138. 1  tests/model_formsets_regress/tests.py
  139. 22  tests/model_inheritance/models.py
  140. 37  tests/model_inheritance_regress/models.py
  141. 1  tests/model_inheritance_same_model_name/models.py
  142. 2  tests/model_inheritance_select_related/models.py
  143. 1  tests/model_validation/models.py
  144. 3  tests/modeladmin/models.py
  145. 6  tests/multiple_database/models.py
  146. 216  tests/multiple_database/tests.py
  147. 1  tests/mutually_referential/models.py
  148. 2  tests/nested_foreign_keys/models.py
  149. 7  tests/null_fk/models.py
  150. 4  tests/null_fk_ordering/models.py
  151. 5  tests/null_queries/models.py
  152. 9  tests/one_to_one/models.py
  153. 1  tests/one_to_one/tests.py
  154. 2  tests/order_with_respect_to/models.py
  155. 1  tests/ordering/models.py
  156. 5  tests/prefetch_related/models.py
  157. 2  tests/proxy_model_inheritance/models.py
  158. 26  tests/proxy_models/models.py
  159. 91  tests/queries/models.py
  160. 40  tests/queries/tests.py
  161. 6  tests/queryset_pickle/models.py
  162. 4  tests/raw_query/models.py
  163. 1  tests/responses/tests.py
  164. 2  tests/reverse_lookup/models.py
  165. 2  tests/reverse_single_related/models.py
  166. 10  tests/select_related/models.py
  167. 2  tests/select_related_onetoone/models.py
  168. 28  tests/select_related_regress/models.py
  169. 12  tests/serializers/tests.py
  170. 63  tests/serializers_regress/models.py
  171. 24  tests/serializers_regress/tests.py
  172. 1  tests/servers/tests.py
  173. 1  tests/settings_tests/tests.py
  174. 1  tests/signals/models.py
  175. 2  tests/signals/tests.py
  176. 1  tests/signals_regress/models.py
  177. 1  tests/signing/tests.py
  178. 6  tests/sites_framework/models.py
  179. 1  tests/staticfiles_tests/storage.py
  180. 1  tests/str/models.py
  181. 5  tests/string_lookup/models.py
  182. 1  tests/syndication/tests.py
  183. 4  tests/tablespaces/models.py
  184. 2  tests/tablespaces/tests.py
  185. 13  tests/template_tests/filters.py
  186. 2  tests/template_tests/templatetags/bad_tag.py
  187. 49  tests/template_tests/templatetags/custom.py
  188. 1  tests/template_tests/templatetags/subpackage/echo.py
  189. 1  tests/template_tests/test_callables.py
  190. 13  tests/template_tests/test_loaders.py
  191. 3  tests/template_tests/test_nodelist.py
  192. 5  tests/template_tests/test_response.py
  193. 1  tests/template_tests/test_smartif.py
  194. 31  tests/template_tests/tests.py
  195. 5  tests/template_tests/views.py
  196. 4  tests/test_client/tests.py
  197. 22  tests/test_client/views.py
  198. 1  tests/test_client_regress/session.py
  199. 28  tests/test_client_regress/tests.py
  200. 18  tests/test_client_regress/views.py
  201. 1  tests/test_runner/models.py
  202. 1  tests/test_runner_deprecation_app/tests.py
  203. 1  tests/test_utils/models.py
  204. 2  tests/timezones/admin.py
  205. 5  tests/timezones/forms.py
  206. 6  tests/timezones/models.py
  207. 16  tests/transactions/tests.py
  208. 2  tests/transactions_regress/models.py
  209. 5  tests/transactions_regress/tests.py
  210. 13  tests/unmanaged_models/models.py
  211. 4  tests/update/models.py
  212. 1  tests/update_only_fields/models.py
  213. 1  tests/urlpatterns_reverse/erroneous_views_module.py
  214. 5  tests/urlpatterns_reverse/middleware.py
  215. 12  tests/urlpatterns_reverse/tests.py
  216. 1  tests/urlpatterns_reverse/urlconf_inner.py
  217. 10  tests/urlpatterns_reverse/views.py
  218. 1  tests/user_commands/management/commands/leave_locale_alone_false.py
  219. 1  tests/user_commands/management/commands/leave_locale_alone_true.py
  220. 1  tests/utils_tests/test_baseconv.py
  221. 1  tests/utils_tests/test_checksums.py
  222. 1  tests/utils_tests/test_datetime_safe.py
  223. 1  tests/utils_tests/test_decorators.py
  224. 1  tests/utils_tests/test_ipv6.py
  225. 3  tests/utils_tests/test_jslex.py
  226. 5  tests/utils_tests/test_module_loading.py
  227. 1  tests/utils_tests/test_simplelazyobject.py
  228. 1  tests/utils_tests/test_text.py
  229. 9  tests/utils_tests/test_tzinfo.py
  230. 13  tests/validation/models.py
  231. 1  tests/validation/test_unique.py
  232. 3  tests/validation/tests.py
  233. 10  tests/validators/tests.py
  234. 1  tests/version/tests.py
  235. 1  tests/view_tests/__init__.py
  236. 5  tests/view_tests/models.py
  237. 1  tests/view_tests/templatetags/debugtags.py
  238. 3  tests/view_tests/tests/test_debug.py
  239. 1  tests/view_tests/tests/test_shortcuts.py
  240. 32  tests/view_tests/views.py
  241. 1  tests/wsgi/urls.py
3  django/forms/widgets.py
@@ -387,7 +387,8 @@ def render(self, name, value, attrs=None):
387 387
     def value_from_datadict(self, data, files, name):
388 388
         upload = super(ClearableFileInput, self).value_from_datadict(data, files, name)
389 389
         if not self.is_required and CheckboxInput().value_from_datadict(
390  
-            data, files, self.clear_checkbox_name(name)):
  390
+                data, files, self.clear_checkbox_name(name)):
  391
+
391 392
             if upload:
392 393
                 # If the user contradicts themselves (uploads a new file AND
393 394
                 # checks the "clear" checkbox), we return a unique marker
2  setup.cfg
@@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh
4 4
 
5 5
 [flake8]
6 6
 exclude=./django/utils/dictconfig.py,./django/contrib/comments/*,./django/utils/unittest.py,./tests/comment_tests/*,./django/test/_doctest.py,./django/utils/six.py,./django/conf/app_template/*
7  
-ignore=E124,E125,E127,E128,E226,E251,E302,E501,W601
  7
+ignore=E124,E125,E127,E128,E226,E251,E501,W601
8 8
 
9 9
 [metadata]
10 10
 license-file = LICENSE
15  tests/admin_changelist/models.py
... ...
@@ -1,26 +1,32 @@
1 1
 from django.db import models
2 2
 from django.utils.encoding import python_2_unicode_compatible
3 3
 
  4
+
4 5
 class Event(models.Model):
5 6
     # Oracle can have problems with a column named "date"
6 7
     date = models.DateField(db_column="event_date")
7 8
 
  9
+
8 10
 class Parent(models.Model):
9 11
     name = models.CharField(max_length=128)
10 12
 
  13
+
11 14
 class Child(models.Model):
12 15
     parent = models.ForeignKey(Parent, editable=False, null=True)
13 16
     name = models.CharField(max_length=30, blank=True)
14 17
     age = models.IntegerField(null=True, blank=True)
15 18
 
  19
+
16 20
 class Genre(models.Model):
17 21
     name = models.CharField(max_length=20)
18 22
 
  23
+
19 24
 class Band(models.Model):
20 25
     name = models.CharField(max_length=20)
21 26
     nr_of_members = models.PositiveIntegerField()
22 27
     genres = models.ManyToManyField(Genre)
23 28
 
  29
+
24 30
 @python_2_unicode_compatible
25 31
 class Musician(models.Model):
26 32
     name = models.CharField(max_length=30)
@@ -28,6 +34,7 @@ class Musician(models.Model):
28 34
     def __str__(self):
29 35
         return self.name
30 36
 
  37
+
31 38
 @python_2_unicode_compatible
32 39
 class Group(models.Model):
33 40
     name = models.CharField(max_length=30)
@@ -36,26 +43,32 @@ class Group(models.Model):
36 43
     def __str__(self):
37 44
         return self.name
38 45
 
  46
+
39 47
 class Membership(models.Model):
40 48
     music = models.ForeignKey(Musician)
41 49
     group = models.ForeignKey(Group)
42 50
     role = models.CharField(max_length=15)
43 51
 
  52
+
44 53
 class Quartet(Group):
45 54
     pass
46 55
 
  56
+
47 57
 class ChordsMusician(Musician):
48 58
     pass
49 59
 
  60
+
50 61
 class ChordsBand(models.Model):
51 62
     name = models.CharField(max_length=30)
52 63
     members = models.ManyToManyField(ChordsMusician, through='Invitation')
53 64
 
  65
+
54 66
 class Invitation(models.Model):
55 67
     player = models.ForeignKey(ChordsMusician)
56 68
     band = models.ForeignKey(ChordsBand)
57 69
     instrument = models.CharField(max_length=15)
58 70
 
  71
+
59 72
 class Swallow(models.Model):
60 73
     origin = models.CharField(max_length=255)
61 74
     load = models.FloatField()
@@ -77,6 +90,7 @@ class OrderedObjectManager(models.Manager):
77 90
     def get_queryset(self):
78 91
         return super(OrderedObjectManager, self).get_queryset().order_by('number')
79 92
 
  93
+
80 94
 class OrderedObject(models.Model):
81 95
     """
82 96
     Model with Manager that defines a default order.
@@ -88,5 +102,6 @@ class OrderedObject(models.Model):
88 102
 
89 103
     objects = OrderedObjectManager()
90 104
 
  105
+
91 106
 class CustomIdUser(models.Model):
92 107
     uuid = models.AutoField(primary_key=True)
2  tests/admin_custom_urls/models.py
@@ -54,6 +54,7 @@ def wrapper(*args, **kwargs):
54 54
 class Person(models.Model):
55 55
     name = models.CharField(max_length=20)
56 56
 
  57
+
57 58
 class PersonAdmin(admin.ModelAdmin):
58 59
 
59 60
     def response_post_save_add(self, request, obj):
@@ -68,6 +69,7 @@ def response_post_save_change(self, request, obj):
68 69
 class Car(models.Model):
69 70
     name = models.CharField(max_length=20)
70 71
 
  72
+
71 73
 class CarAdmin(admin.ModelAdmin):
72 74
 
73 75
     def response_add(self, request, obj, post_url_continue=None):
2  tests/admin_docs/views.py
@@ -5,9 +5,11 @@
5 5
 
6 6
 xview_dec = decorator_from_middleware(XViewMiddleware)
7 7
 
  8
+
8 9
 def xview(request):
9 10
     return HttpResponse()
10 11
 
  12
+
11 13
 class XViewClass(View):
12 14
     def get(self, request):
13 15
         return HttpResponse()
1  tests/admin_filters/models.py
@@ -27,6 +27,7 @@ class Department(models.Model):
27 27
     def __str__(self):
28 28
         return self.description
29 29
 
  30
+
30 31
 @python_2_unicode_compatible
31 32
 class Employee(models.Model):
32 33
     department = models.ForeignKey(Department, to_field="code")
3  tests/admin_inlines/admin.py
@@ -153,6 +153,7 @@ class ChildModel1Inline(admin.TabularInline):
153 153
 class ChildModel2Inline(admin.StackedInline):
154 154
     model = ChildModel2
155 155
 
  156
+
156 157
 # admin for #19425 and #18388
157 158
 class BinaryTreeAdmin(admin.TabularInline):
158 159
     model = BinaryTree
@@ -169,10 +170,12 @@ def get_max_num(self, request, obj=None, **kwargs):
169 170
             return max_num - obj.binarytree_set.count()
170 171
         return max_num
171 172
 
  173
+
172 174
 # admin for #19524
173 175
 class SightingInline(admin.TabularInline):
174 176
     model = Sighting
175 177
 
  178
+
176 179
 # admin and form for #18263
177 180
 class SomeChildModelForm(forms.ModelForm):
178 181
 
21  tests/admin_inlines/models.py
@@ -89,6 +89,7 @@ class Inner2(models.Model):
89 89
     dummy = models.IntegerField()
90 90
     holder = models.ForeignKey(Holder2)
91 91
 
  92
+
92 93
 class Holder3(models.Model):
93 94
     dummy = models.IntegerField()
94 95
 
@@ -99,38 +100,47 @@ class Inner3(models.Model):
99 100
 
100 101
 # Models for ticket #8190
101 102
 
  103
+
102 104
 class Holder4(models.Model):
103 105
     dummy = models.IntegerField()
104 106
 
  107
+
105 108
 class Inner4Stacked(models.Model):
106 109
     dummy = models.IntegerField(help_text="Awesome stacked help text is awesome.")
107 110
     holder = models.ForeignKey(Holder4)
108 111
 
  112
+
109 113
 class Inner4Tabular(models.Model):
110 114
     dummy = models.IntegerField(help_text="Awesome tabular help text is awesome.")
111 115
     holder = models.ForeignKey(Holder4)
112 116
 
113 117
 # Models for #12749
114 118
 
  119
+
115 120
 class Person(models.Model):
116 121
     firstname = models.CharField(max_length=15)
117 122
 
  123
+
118 124
 class OutfitItem(models.Model):
119 125
     name = models.CharField(max_length=15)
120 126
 
  127
+
121 128
 class Fashionista(models.Model):
122 129
     person = models.OneToOneField(Person, primary_key=True)
123 130
     weaknesses = models.ManyToManyField(OutfitItem, through='ShoppingWeakness', blank=True)
124 131
 
  132
+
125 133
 class ShoppingWeakness(models.Model):
126 134
     fashionista = models.ForeignKey(Fashionista)
127 135
     item = models.ForeignKey(OutfitItem)
128 136
 
129 137
 # Models for #13510
130 138
 
  139
+
131 140
 class TitleCollection(models.Model):
132 141
     pass
133 142
 
  143
+
134 144
 class Title(models.Model):
135 145
     collection = models.ForeignKey(TitleCollection, blank=True, null=True)
136 146
     title1 = models.CharField(max_length=100)
@@ -138,19 +148,24 @@ class Title(models.Model):
138 148
 
139 149
 # Models for #15424
140 150
 
  151
+
141 152
 class Poll(models.Model):
142 153
     name = models.CharField(max_length=40)
143 154
 
  155
+
144 156
 class Question(models.Model):
145 157
     poll = models.ForeignKey(Poll)
146 158
 
  159
+
147 160
 class Novel(models.Model):
148 161
     name = models.CharField(max_length=40)
149 162
 
  163
+
150 164
 class Chapter(models.Model):
151 165
     name = models.CharField(max_length=40)
152 166
     novel = models.ForeignKey(Novel)
153 167
 
  168
+
154 169
 class FootNote(models.Model):
155 170
     """
156 171
     Model added for ticket 19838
@@ -160,6 +175,7 @@ class FootNote(models.Model):
160 175
 
161 176
 # Models for #16838
162 177
 
  178
+
163 179
 class CapoFamiglia(models.Model):
164 180
     name = models.CharField(max_length=100)
165 181
 
@@ -211,12 +227,15 @@ class BinaryTree(models.Model):
211 227
 
212 228
 # Models for #19524
213 229
 
  230
+
214 231
 class LifeForm(models.Model):
215 232
     pass
216 233
 
  234
+
217 235
 class ExtraTerrestrial(LifeForm):
218 236
     name = models.CharField(max_length=100)
219 237
 
  238
+
220 239
 class Sighting(models.Model):
221 240
     et = models.ForeignKey(ExtraTerrestrial)
222 241
     place = models.CharField(max_length=100)
@@ -234,9 +253,11 @@ class SomeChildModel(models.Model):
234 253
 
235 254
 # Other models
236 255
 
  256
+
237 257
 class ProfileCollection(models.Model):
238 258
     pass
239 259
 
  260
+
240 261
 class Profile(models.Model):
241 262
     collection = models.ForeignKey(ProfileCollection, blank=True, null=True)
242 263
     first_name = models.CharField(max_length=100)
24  tests/admin_inlines/tests.py
@@ -279,6 +279,7 @@ def test_all_inline_media(self):
279 279
         self.assertContains(response, 'my_awesome_admin_scripts.js')
280 280
         self.assertContains(response, 'my_awesome_inline_scripts.js')
281 281
 
  282
+
282 283
 class TestInlineAdminForm(TestCase):
283 284
     urls = "admin_inlines.urls"
284 285
 
@@ -465,9 +466,9 @@ def test_inline_change_fk_add_perm(self):
465 466
         self.assertContains(response, 'Add another Inner2')
466 467
         # 3 extra forms only, not the existing instance form
467 468
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
468  
-                                'value="3" name="inner2_set-TOTAL_FORMS" />', html=True)
  469
+            'value="3" name="inner2_set-TOTAL_FORMS" />', html=True)
469 470
         self.assertNotContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
470  
-                            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
  471
+            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
471 472
 
472 473
     def test_inline_change_fk_change_perm(self):
473 474
         permission = Permission.objects.get(codename='change_inner2', content_type=self.inner_ct)
@@ -477,12 +478,12 @@ def test_inline_change_fk_change_perm(self):
477 478
         self.assertContains(response, '<h2>Inner2s</h2>')
478 479
         # Just the one form for existing instances
479 480
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
480  
-                                'value="1" name="inner2_set-TOTAL_FORMS" />', html=True)
  481
+            'value="1" name="inner2_set-TOTAL_FORMS" />', html=True)
481 482
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
482  
-                            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
  483
+            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
483 484
         # max-num 0 means we can't add new ones
484 485
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-MAX_NUM_FORMS" '
485  
-                                'value="0" name="inner2_set-MAX_NUM_FORMS" />', html=True)
  486
+            'value="0" name="inner2_set-MAX_NUM_FORMS" />', html=True)
486 487
 
487 488
     def test_inline_change_fk_add_change_perm(self):
488 489
         permission = Permission.objects.get(codename='add_inner2', content_type=self.inner_ct)
@@ -494,9 +495,9 @@ def test_inline_change_fk_add_change_perm(self):
494 495
         self.assertContains(response, '<h2>Inner2s</h2>')
495 496
         # One form for existing instance and three extra for new
496 497
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
497  
-                                'value="4" name="inner2_set-TOTAL_FORMS" />', html=True)
  498
+            'value="4" name="inner2_set-TOTAL_FORMS" />', html=True)
498 499
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
499  
-                            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
  500
+            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
500 501
 
501 502
     def test_inline_change_fk_change_del_perm(self):
502 503
         permission = Permission.objects.get(codename='change_inner2', content_type=self.inner_ct)
@@ -508,9 +509,9 @@ def test_inline_change_fk_change_del_perm(self):
508 509
         self.assertContains(response, '<h2>Inner2s</h2>')
509 510
         # One form for existing instance only, no new
510 511
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
511  
-                                'value="1" name="inner2_set-TOTAL_FORMS" />', html=True)
  512
+            'value="1" name="inner2_set-TOTAL_FORMS" />', html=True)
512 513
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
513  
-                            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
  514
+            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
514 515
         self.assertContains(response, 'id="id_inner2_set-0-DELETE"')
515 516
 
516 517
     def test_inline_change_fk_all_perms(self):
@@ -525,9 +526,9 @@ def test_inline_change_fk_all_perms(self):
525 526
         self.assertContains(response, '<h2>Inner2s</h2>')
526 527
         # One form for existing instance only, three for new
527 528
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
528  
-                                'value="4" name="inner2_set-TOTAL_FORMS" />', html=True)
  529
+            'value="4" name="inner2_set-TOTAL_FORMS" />', html=True)
529 530
         self.assertContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
530  
-                            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
  531
+            'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
531 532
         self.assertContains(response, 'id="id_inner2_set-0-DELETE"')
532 533
 
533 534
 
@@ -698,5 +699,6 @@ def test_alternating_rows(self):
698 699
 class SeleniumChromeTests(SeleniumFirefoxTests):
699 700
     webdriver_class = 'selenium.webdriver.chrome.webdriver.WebDriver'
700 701
 
  702
+
701 703
 class SeleniumIETests(SeleniumFirefoxTests):
702 704
     webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver'
4  tests/admin_ordering/models.py
@@ -11,6 +11,7 @@ class Band(models.Model):
11 11
     class Meta:
12 12
         ordering = ('name',)
13 13
 
  14
+
14 15
 class Song(models.Model):
15 16
     band = models.ForeignKey(Band)
16 17
     name = models.CharField(max_length=100)
@@ -20,13 +21,16 @@ class Song(models.Model):
20 21
     class Meta:
21 22
         ordering = ('name',)
22 23
 
  24
+
23 25
 class SongInlineDefaultOrdering(admin.StackedInline):
24 26
     model = Song
25 27
 
  28
+
26 29
 class SongInlineNewOrdering(admin.StackedInline):
27 30
     model = Song
28 31
     ordering = ('duration', )
29 32
 
  33
+
30 34
 class DynOrderingBandAdmin(admin.ModelAdmin):
31 35
 
32 36
     def get_ordering(self, request):
1  tests/admin_ordering/tests.py
@@ -12,6 +12,7 @@
12 12
 class MockRequest(object):
13 13
     pass
14 14
 
  15
+
15 16
 class MockSuperUser(object):
16 17
     def has_perm(self, perm):
17 18
         return True
9  tests/admin_scripts/tests.py
@@ -289,6 +289,7 @@ def test_custom_command_with_environment(self):
289 289
         self.assertNoOutput(err)
290 290
         self.assertOutput(out, "EXECUTE:NoArgsCommand")
291 291
 
  292
+
292 293
 class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase):
293 294
     """A series of tests for django-admin.py when using a settings.py file that
294 295
     contains the test application specified using a full path.
@@ -355,6 +356,7 @@ def test_custom_command_with_environment(self):
355 356
         self.assertNoOutput(err)
356 357
         self.assertOutput(out, "EXECUTE:NoArgsCommand")
357 358
 
  359
+
358 360
 class DjangoAdminMinimalSettings(AdminScriptTestCase):
359 361
     """A series of tests for django-admin.py when using a settings.py file that
360 362
     doesn't contain the test application.
@@ -421,6 +423,7 @@ def test_custom_command_with_environment(self):
421 423
         self.assertNoOutput(out)
422 424
         self.assertOutput(err, "Unknown command: 'noargs_command'")
423 425
 
  426
+
424 427
 class DjangoAdminAlternateSettings(AdminScriptTestCase):
425 428
     """A series of tests for django-admin.py when using a settings file
426 429
     with a name other than 'settings.py'.
@@ -796,6 +799,7 @@ def test_custom_command_with_environment(self):
796 799
         self.assertNoOutput(err)
797 800
         self.assertOutput(out, "EXECUTE:NoArgsCommand")
798 801
 
  802
+
799 803
 class ManageMinimalSettings(AdminScriptTestCase):
800 804
     """A series of tests for manage.py when using a settings.py file that
801 805
     doesn't contain the test application.
@@ -862,6 +866,7 @@ def test_custom_command_with_environment(self):
862 866
         self.assertNoOutput(out)
863 867
         self.assertOutput(err, "Unknown command: 'noargs_command'")
864 868
 
  869
+
865 870
 class ManageAlternateSettings(AdminScriptTestCase):
866 871
     """A series of tests for manage.py when using a settings file
867 872
     with a name other than 'settings.py'.
@@ -1121,6 +1126,7 @@ def __init__(self, *args, **kwargs):
1121 1126
     def run_tests(self, test_labels, extra_tests=None, **kwargs):
1122 1127
         pass
1123 1128
 
  1129
+
1124 1130
 class ManageTestCommand(AdminScriptTestCase):
1125 1131
     def setUp(self):
1126 1132
         from django.core.management.commands.test import Command as TestCommand
@@ -1214,6 +1220,7 @@ def test_runner_ambiguous(self):
1214 1220
         self.cmd.handle(addrport="deadbeef:7654")
1215 1221
         self.assertServerSettings('deadbeef', '7654')
1216 1222
 
  1223
+
1217 1224
 class ManageRunserverEmptyAllowedHosts(AdminScriptTestCase):
1218 1225
     def setUp(self):
1219 1226
         self.write_settings('settings.py', sdict={
@@ -1464,6 +1471,7 @@ def test_label_command_multiple_label(self):
1464 1471
         self.assertOutput(out, str_prefix("EXECUTE:LabelCommand label=testlabel, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity', %(_)s'1')]"))
1465 1472
         self.assertOutput(out, str_prefix("EXECUTE:LabelCommand label=anotherlabel, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity', %(_)s'1')]"))
1466 1473
 
  1474
+
1467 1475
 class ArgumentOrder(AdminScriptTestCase):
1468 1476
     """Tests for 2-stage argument parsing scheme.
1469 1477
 
@@ -1751,6 +1759,7 @@ def test_all(self):
1751 1759
         self.assertNoOutput(err)
1752 1760
         self.assertOutput(out, "### STATIC_URL = None")
1753 1761
 
  1762
+
1754 1763
 class Dumpdata(AdminScriptTestCase):
1755 1764
     """Tests for dumpdata management command."""
1756 1765
 
5  tests/admin_util/models.py
@@ -19,6 +19,7 @@ def test_from_model_with_override(self):
19 19
         return "nothing"
20 20
     test_from_model_with_override.short_description = "not What you Expect"
21 21
 
  22
+
22 23
 @python_2_unicode_compatible
23 24
 class Count(models.Model):
24 25
     num = models.PositiveSmallIntegerField()
@@ -27,12 +28,15 @@ class Count(models.Model):
27 28
     def __str__(self):
28 29
         return six.text_type(self.num)
29 30
 
  31
+
30 32
 class Event(models.Model):
31 33
     date = models.DateTimeField(auto_now_add=True)
32 34
 
  35
+
33 36
 class Location(models.Model):
34 37
     event = models.OneToOneField(Event, verbose_name='awesome event')
35 38
 
  39
+
36 40
 class Guest(models.Model):
37 41
     event = models.OneToOneField(Event)
38 42
     name = models.CharField(max_length=255)
@@ -40,5 +44,6 @@ class Guest(models.Model):
40 44
     class Meta:
41 45
         verbose_name = "awesome guest"
42 46
 
  47
+
43 48
 class EventGuide(models.Model):
44 49
     event = models.ForeignKey(Event, on_delete=models.DO_NOTHING)
6  tests/admin_util/tests.py
@@ -80,6 +80,7 @@ def test_on_delete_do_nothing(self):
80 80
             # One for Location, one for Guest, and no query for EventGuide
81 81
             n.collect(objs)
82 82
 
  83
+
83 84
 class UtilTests(SimpleTestCase):
84 85
     def test_values_from_lookup_field(self):
85 86
         """
@@ -228,9 +229,8 @@ def test_from_model(self, obj):
228 229
         )
229 230
         self.assertEqual(
230 231
             label_for_field("test_from_model", Article,
231  
-                model_admin = MockModelAdmin,
232  
-                return_attr = True
233  
-            ),
  232
+                model_admin=MockModelAdmin,
  233
+                return_attr=True),
234 234
             ("not Really the Model", MockModelAdmin.test_from_model)
235 235
         )
236 236
 
3  tests/admin_validation/tests.py
@@ -12,10 +12,12 @@
12 12
 class SongForm(forms.ModelForm):
13 13
     pass
14 14
 
  15
+
15 16
 class ValidFields(admin.ModelAdmin):
16 17
     form = SongForm
17 18
     fields = ['title']
18 19
 
  20
+
19 21
 class ValidFormFieldsets(admin.ModelAdmin):
20 22
     def get_form(self, request, obj=None, **kwargs):
21 23
         class ExtraFieldForm(SongForm):
@@ -28,6 +30,7 @@ class ExtraFieldForm(SongForm):
28 30
         }),
29 31
     )
30 32
 
  33
+
31 34
 class ValidationTestCase(TestCase):
32 35
 
33 36
     def test_readonly_and_editable(self):
22  tests/admin_views/admin.py
@@ -58,6 +58,7 @@ class ArticleInline(admin.TabularInline):
58 58
         })
59 59
     )
60 60
 
  61
+
61 62
 class ChapterInline(admin.TabularInline):
62 63
     model = Chapter
63 64
 
@@ -578,10 +579,12 @@ class AdminOrderedFieldAdmin(admin.ModelAdmin):
578 579
     ordering = ('order',)
579 580
     list_display = ('stuff', 'order')
580 581
 
  582
+
581 583
 class AdminOrderedModelMethodAdmin(admin.ModelAdmin):
582 584
     ordering = ('order',)
583 585
     list_display = ('stuff', 'some_order')
584 586
 
  587
+
585 588
 class AdminOrderedAdminMethodAdmin(admin.ModelAdmin):
586 589
     def some_admin_order(self, obj):
587 590
         return obj.order
@@ -589,13 +592,17 @@ def some_admin_order(self, obj):
589 592
     ordering = ('order',)
590 593
     list_display = ('stuff', 'some_admin_order')
591 594
 
  595
+
592 596
 def admin_ordered_callable(obj):
593 597
     return obj.order
594 598
 admin_ordered_callable.admin_order_field = 'order'
  599
+
  600
+
595 601
 class AdminOrderedCallableAdmin(admin.ModelAdmin):
596 602
     ordering = ('order',)
597 603
     list_display = ('stuff', admin_ordered_callable)
598 604
 
  605
+
599 606
 class ReportAdmin(admin.ModelAdmin):
600 607
     def extra(self, request):
601 608
         return HttpResponse()
@@ -612,6 +619,7 @@ def get_urls(self):
612 619
 class CustomTemplateBooleanFieldListFilter(BooleanFieldListFilter):
613 620
     template = 'custom_filter_template.html'
614 621
 
  622
+
615 623
 class CustomTemplateFilterColorAdmin(admin.ModelAdmin):
616 624
     list_filter = (('warm', CustomTemplateBooleanFieldListFilter),)
617 625
 
@@ -628,12 +636,14 @@ class RelatedPrepopulatedInline1(admin.StackedInline):
628 636
     prepopulated_fields = {'slug1': ['name', 'pubdate'],
629 637
                            'slug2': ['status', 'name']}
630 638
 
  639
+
631 640
 class RelatedPrepopulatedInline2(admin.TabularInline):
632 641
     model = RelatedPrepopulated
633 642
     extra = 1
634 643
     prepopulated_fields = {'slug1': ['name', 'pubdate'],
635 644
                            'slug2': ['status', 'name']}
636 645
 
  646
+
637 647
 class MainPrepopulatedAdmin(admin.ModelAdmin):
638 648
     inlines = [RelatedPrepopulatedInline1, RelatedPrepopulatedInline2]
639 649
     fieldsets = (
@@ -712,14 +722,17 @@ class FormWithoutHiddenField(forms.ModelForm):
712 722
     first = forms.CharField()
713 723
     second = forms.CharField()
714 724
 
  725
+
715 726
 class FormWithoutVisibleField(forms.ModelForm):
716 727
     first = forms.CharField(widget=forms.HiddenInput)
717 728
     second = forms.CharField(widget=forms.HiddenInput)
718 729
 
  730
+
719 731
 class FormWithVisibleAndHiddenField(forms.ModelForm):
720 732
     first = forms.CharField(widget=forms.HiddenInput)
721 733
     second = forms.CharField()
722 734
 
  735
+
723 736
 class EmptyModelVisibleAdmin(admin.ModelAdmin):
724 737
     form = FormWithoutHiddenField
725 738
     fieldsets = (
@@ -728,39 +741,48 @@ class EmptyModelVisibleAdmin(admin.ModelAdmin):
728 741
         }),
729 742
     )
730 743
 
  744
+
731 745
 class EmptyModelHiddenAdmin(admin.ModelAdmin):
732 746
     form = FormWithoutVisibleField
733 747
     fieldsets = EmptyModelVisibleAdmin.fieldsets
734 748
 
  749
+
735 750
 class EmptyModelMixinAdmin(admin.ModelAdmin):
736 751
     form = FormWithVisibleAndHiddenField
737 752
     fieldsets = EmptyModelVisibleAdmin.fieldsets
738 753
 
  754
+
739 755
 class CityInlineAdmin(admin.TabularInline):
740 756
     model = City
741 757
     view_on_site = False
742 758
 
  759
+
743 760
 class StateAdmin(admin.ModelAdmin):
744 761
     inlines = [CityInlineAdmin]
745 762
 
  763
+
746 764
 class RestaurantInlineAdmin(admin.TabularInline):
747 765
     model = Restaurant
748 766
     view_on_site = True
749 767
 
  768
+
750 769
 class CityAdmin(admin.ModelAdmin):
751 770
     inlines = [RestaurantInlineAdmin]
752 771
     view_on_site = True
753 772
 
  773
+
754 774
 class WorkerAdmin(admin.ModelAdmin):
755 775
     def view_on_site(self, obj):
756 776
         return '/worker/%s/%s/' % (obj.surname, obj.name)
757 777
 
  778
+
758 779
 class WorkerInlineAdmin(admin.TabularInline):
759 780
     model = Worker
760 781
 
761 782
     def view_on_site(self, obj):
762 783
         return '/worker_inline/%s/%s/' % (obj.surname, obj.name)
763 784
 
  785
+
764 786
 class RestaurantAdmin(admin.ModelAdmin):
765 787
     inlines = [WorkerInlineAdmin]
766 788
     view_on_site = False
22  tests/admin_views/models.py
@@ -120,11 +120,13 @@ class Color(models.Model):
120 120
     def __str__(self):
121 121
         return self.value
122 122
 
  123
+
123 124
 # we replicate Color to register with another ModelAdmin
124 125
 class Color2(Color):
125 126
     class Meta:
126 127
         proxy = True
127 128
 
  129
+
128 130
 @python_2_unicode_compatible
129 131
 class Thing(models.Model):
130 132
     title = models.CharField(max_length=20)
@@ -613,10 +615,12 @@ class PrePopulatedPostLargeSlug(models.Model):
613 615
     published = models.BooleanField(default=False)
614 616
     slug = models.SlugField(max_length=1000)
615 617
 
  618
+
616 619
 class AdminOrderedField(models.Model):
617 620
     order = models.IntegerField()
618 621
     stuff = models.CharField(max_length=200)
619 622
 
  623
+
620 624
 class AdminOrderedModelMethod(models.Model):
621 625
     order = models.IntegerField()
622 626
     stuff = models.CharField(max_length=200)
@@ -625,14 +629,17 @@ def some_order(self):
625 629
         return self.order
626 630
     some_order.admin_order_field = 'order'
627 631
 
  632
+
628 633
 class AdminOrderedAdminMethod(models.Model):
629 634
     order = models.IntegerField()
630 635
     stuff = models.CharField(max_length=200)
631 636
 
  637
+
632 638
 class AdminOrderedCallable(models.Model):
633 639
     order = models.IntegerField()
634 640
     stuff = models.CharField(max_length=200)
635 641
 
  642
+
636 643
 @python_2_unicode_compatible
637 644
 class Report(models.Model):
638 645
     title = models.CharField(max_length=100)
@@ -651,6 +658,7 @@ class MainPrepopulated(models.Model):
651 658
     slug1 = models.SlugField(blank=True)
652 659
     slug2 = models.SlugField(blank=True)
653 660
 
  661
+
654 662
 class RelatedPrepopulated(models.Model):
655 663
     parent = models.ForeignKey(MainPrepopulated)
656 664
     name = models.CharField(max_length=75)
@@ -671,6 +679,7 @@ class UnorderedObject(models.Model):
671 679
     name = models.CharField(max_length=255)
672 680
     bool = models.BooleanField(default=True)
673 681
 
  682
+
674 683
 class UndeletableObject(models.Model):
675 684
     """
676 685
     Model whose show_delete in admin change_view has been disabled
@@ -678,30 +687,36 @@ class UndeletableObject(models.Model):
678 687
     """
679 688
     name = models.CharField(max_length=255)
680 689
 
  690
+
681 691
 class UnchangeableObject(models.Model):
682 692
     """
683 693
     Model whose change_view is disabled in admin
684 694
     Refs #20640.
685 695
     """
686 696
 
  697
+
687 698
 class UserMessenger(models.Model):
688 699
     """
689 700
     Dummy class for testing message_user functions on ModelAdmin
690 701
     """
691 702
 
  703
+
692 704
 class Simple(models.Model):
693 705
     """
694 706
     Simple model with nothing on it for use in testing
695 707
     """
696 708
 
  709
+
697 710
 class Choice(models.Model):
698 711
     choice = models.IntegerField(blank=True, null=True,
699 712
         choices=((1, 'Yes'), (0, 'No'), (None, 'No opinion')))
700 713
 
  714
+
701 715
 class _Manager(models.Manager):
702 716
     def get_queryset(self):
703 717
         return super(_Manager, self).get_queryset().filter(pk__gt=1)
704 718
 
  719
+
705 720
 class FilteredManager(models.Model):
706 721
     def __str__(self):
707 722
         return "PK=%d" % self.pk
@@ -709,26 +724,33 @@ def __str__(self):
709 724
     pk_gt_1 = _Manager()
710 725
     objects = models.Manager()
711 726
 
  727
+
712 728
 class EmptyModelVisible(models.Model):
713 729
     """ See ticket #11277. """
714 730
 
  731
+
715 732
 class EmptyModelHidden(models.Model):
716 733
     """ See ticket #11277. """
717 734
 
  735
+
718 736
 class EmptyModelMixin(models.Model):
719 737
     """ See ticket #11277. """
720 738
 
  739
+
721 740
 class State(models.Model):
722 741
     name = models.CharField(max_length=100)
723 742
 
  743
+
724 744
 class City(models.Model):
725 745
     state = models.ForeignKey(State)
726 746
     name = models.CharField(max_length=100)
727 747
 
  748
+
728 749
 class Restaurant(models.Model):
729 750
     city = models.ForeignKey(City)
730 751
     name = models.CharField(max_length=100)
731 752
 
  753
+
732 754
 class Worker(models.Model):
733 755
     work_at = models.ForeignKey(Restaurant)
734 756
     name = models.CharField(max_length=50)
35  tests/admin_views/tests.py
@@ -84,8 +84,8 @@ def assertContentBefore(self, response, text1, text2, failing_msg=None):
84 84
         """
85 85
         self.assertEqual(response.status_code, 200)
86 86
         self.assertTrue(response.content.index(force_bytes(text1)) < response.content.index(force_bytes(text2)),
87  
-            failing_msg
88  
-        )
  87
+            failing_msg)
  88
+
89 89
 
90 90
 class AdminViewBasicTest(AdminViewBasicTestCase):
91 91
     def testTrailingSlashRequired(self):
@@ -94,8 +94,8 @@ def testTrailingSlashRequired(self):
94 94
         """
95 95
         response = self.client.get('/test_admin/%s/admin_views/article/add' % self.urlbit)
96 96
         self.assertRedirects(response,
97  
-            '/test_admin/%s/admin_views/article/add/' % self.urlbit, status_code=301
98  
-        )
  97
+            '/test_admin/%s/admin_views/article/add/' % self.urlbit,
  98
+            status_code=301)
99 99
 
100 100
     def testBasicAddGet(self):
101 101
         """
@@ -109,8 +109,7 @@ def testAddWithGETArgs(self):
109 109
         response = self.client.get('/test_admin/%s/admin_views/section/add/' % self.urlbit, {'name': 'My Section'})
110 110
         self.assertEqual(response.status_code, 200)
111 111
         self.assertContains(response, 'value="My Section"',
112  
-            msg_prefix="Couldn't find an input with the right value in the response"
113  
-        )
  112
+            msg_prefix="Couldn't find an input with the right value in the response")
114 113
 
115 114
     def testBasicEditGet(self):
116 115
         """
@@ -394,11 +393,9 @@ def testLimitedFilter(self):
394 393
         response = self.client.get('/test_admin/%s/admin_views/thing/' % self.urlbit)
395 394
         self.assertEqual(response.status_code, 200)
396 395
         self.assertContains(response, '<div id="changelist-filter">',
397  
-            msg_prefix="Expected filter not found in changelist view"
398  
-        )
  396
+            msg_prefix="Expected filter not found in changelist view")
399 397
         self.assertNotContains(response, '<a href="?color__id__exact=3">Blue</a>',
400  
-            msg_prefix="Changelist filter not correctly limited by limit_choices_to"
401  
-        )
  398
+            msg_prefix="Changelist filter not correctly limited by limit_choices_to")
402 399
 
403 400
     def testRelationSpanningFilters(self):
404 401
         response = self.client.get('/test_admin/%s/admin_views/chapterxtra1/' %
@@ -1557,7 +1554,7 @@ def test_recentactions_without_content_type(self):
1557 1554
         response = self.client.get('/test_admin/admin/')
1558 1555
         counted_presence_after = response.content.count(force_bytes(should_contain))
1559 1556
         self.assertEqual(counted_presence_before - 1,
1560  
-                          counted_presence_after)
  1557
+            counted_presence_after)
1561 1558
 
1562 1559
     def test_logentry_get_admin_url(self):
1563 1560
         "LogEntry.get_admin_url returns a URL to edit the entry's object or None for non-existent (possibly deleted) models"
@@ -1612,13 +1609,13 @@ def test_shortcut_view_with_escaping(self):
1612 1609
     def test_change_view_history_link(self):
1613 1610
         """Object history button link should work and contain the pk value quoted."""
1614 1611
         url = reverse('admin:%s_modelwithstringprimarykey_change' %
1615  
-                          ModelWithStringPrimaryKey._meta.app_label,
1616  
-                      args=(quote(self.pk),))
  1612
+            ModelWithStringPrimaryKey._meta.app_label,
  1613
+            args=(quote(self.pk),))
1617 1614
         response = self.client.get(url)
1618 1615
         self.assertEqual(response.status_code, 200)
1619 1616
         expected_link = reverse('admin:%s_modelwithstringprimarykey_history' %
1620  
-                                    ModelWithStringPrimaryKey._meta.app_label,
1621  
-                                args=(quote(self.pk),))
  1617
+            ModelWithStringPrimaryKey._meta.app_label,
  1618
+            args=(quote(self.pk),))
1622 1619
         self.assertContains(response, '<a href="%s" class="historylink"' % expected_link)
1623 1620
 
1624 1621
 
@@ -2553,8 +2550,7 @@ def test_model_without_action_still_has_jquery(self):
2553 2550
         response = self.client.get('/test_admin/admin/admin_views/oldsubscriber/')
2554 2551
         self.assertEqual(response.context["action_form"], None)
2555 2552
         self.assertContains(response, 'jquery.min.js',
2556  
-            msg_prefix="jQuery missing from admin pages for model with no admin actions"
2557  
-        )
  2553
+            msg_prefix="jQuery missing from admin pages for model with no admin actions")
2558 2554
 
2559 2555
     def test_action_column_class(self):
2560 2556
         "Tests that the checkbox column class is present in the response"
@@ -3631,8 +3627,7 @@ def test_readonly_get(self):
3631 3627
         self.assertContains(response, "InlineMultiline<br />test<br />string")
3632 3628
 
3633 3629
         self.assertContains(response,
3634  
-            formats.localize(datetime.date.today() - datetime.timedelta(days=7))
3635  
-        )
  3630
+            formats.localize(datetime.date.today() - datetime.timedelta(days=7)))
3636 3631
 
3637 3632
         self.assertContains(response, '<div class="form-row field-coolness">')
3638 3633
         self.assertContains(response, '<div class="form-row field-awesomeness_level">')
@@ -3829,7 +3824,7 @@ def test_password_mismatch(self):
3829 3824
         adminform = response.context['adminform']
3830 3825
         self.assertTrue('password' not in adminform.form.errors)
3831 3826
         self.assertEqual(adminform.form.errors['password2'],
3832  
-                          ["The two password fields didn't match."])
  3827
+            ["The two password fields didn't match."])
3833 3828
 
3834 3829
     def test_user_fk_popup(self):
3835 3830
         """Quick user addition in a FK popup shouldn't invoke view for further user customization"""
1  tests/admin_views/views.py
... ...
@@ -1,6 +1,7 @@
1 1
 from django.contrib.admin.views.decorators import staff_member_required
2 2
 from django.http import HttpResponse
3 3
 
  4
+
4 5
 @staff_member_required
5 6
 def secure_view(request):
6 7
     return HttpResponse('%s' % request.POST)
14  tests/admin_widgets/models.py
@@ -8,6 +8,7 @@
8 8
 class MyFileField(models.FileField):
9 9
     pass
10 10
 
  11
+
11 12
 @python_2_unicode_compatible
12 13
 class Member(models.Model):
13 14
     name = models.CharField(max_length=100)
@@ -18,6 +19,7 @@ class Member(models.Model):
18 19
     def __str__(self):
19 20
         return self.name
20 21
 
  22
+
21 23
 @python_2_unicode_compatible
22 24
 class Band(models.Model):
23 25
     name = models.CharField(max_length=100)
@@ -27,6 +29,7 @@ class Band(models.Model):
27 29
     def __str__(self):
28 30
         return self.name
29 31
 
  32
+
30 33
 @python_2_unicode_compatible
31 34
 class Album(models.Model):
32 35
     band = models.ForeignKey(Band)
@@ -37,10 +40,12 @@ class Album(models.Model):
37 40
     def __str__(self):
38 41
         return self.name
39 42
 
  43
+
40