Permalink
Browse files

Merge pull request #1852 from jasonamyers/cleanup/PEP8

Cleanup/pep8 tests
  • Loading branch information...
2 parents 91078f5 + 4f151da commit 7288e1b02b2504b1694fe14df2d81e6a354c5610 @alex alex committed Nov 3, 2013
Showing with 1,631 additions and 290 deletions.
  1. +2 −1 django/forms/widgets.py
  2. +1 −1 setup.cfg
  3. +15 −0 tests/admin_changelist/models.py
  4. +2 −0 tests/admin_custom_urls/models.py
  5. +2 −0 tests/admin_docs/views.py
  6. +1 −0 tests/admin_filters/models.py
  7. +3 −0 tests/admin_inlines/admin.py
  8. +21 −0 tests/admin_inlines/models.py
  9. +13 −11 tests/admin_inlines/tests.py
  10. +4 −0 tests/admin_ordering/models.py
  11. +1 −0 tests/admin_ordering/tests.py
  12. +9 −0 tests/admin_scripts/tests.py
  13. +5 −0 tests/admin_util/models.py
  14. +3 −3 tests/admin_util/tests.py
  15. +3 −0 tests/admin_validation/tests.py
  16. +22 −0 tests/admin_views/admin.py
  17. +22 −0 tests/admin_views/models.py
  18. +15 −20 tests/admin_views/tests.py
  19. +1 −0 tests/admin_views/views.py
  20. +14 −0 tests/admin_widgets/models.py
  21. +15 −1 tests/admin_widgets/tests.py
  22. +3 −0 tests/aggregation/models.py
  23. +5 −1 tests/aggregation_regress/models.py
  24. +10 −8 tests/backends/tests.py
  25. +2 −0 tests/basic/models.py
  26. +32 −16 tests/basic/tests.py
  27. +2 −0 tests/bug639/models.py
  28. +5 −0 tests/bulk_create/models.py
  29. +1 −0 tests/cache/closeable_cache.py
  30. +1 −0 tests/cache/liberal_backend.py
  31. +1 −0 tests/cache/models.py
  32. +6 −0 tests/cache/tests.py
  33. +2 −0 tests/check/models.py
  34. +1 −0 tests/check/tests.py
  35. +1 −0 tests/choices/models.py
  36. +1 −0 tests/commands_sql/tests.py
  37. +1 −0 tests/conditional_processing/tests.py
  38. +4 −0 tests/conditional_processing/views.py
  39. +2 −0 tests/contenttypes_tests/models.py
  40. +1 −0 tests/contenttypes_tests/tests.py
  41. +5 −0 tests/csrf_tests/tests.py
  42. +1 −0 tests/custom_columns/models.py
  43. +1 −0 tests/custom_columns_regress/models.py
  44. +1 −0 tests/custom_columns_regress/tests.py
  45. +10 −0 tests/custom_managers/models.py
  46. +3 −0 tests/custom_managers_regress/models.py
  47. +1 −0 tests/custom_pk/fields.py
  48. +3 −1 tests/custom_pk/models.py
  49. +1 −0 tests/datatypes/models.py
  50. +2 −0 tests/dates/models.py
  51. +2 −0 tests/datetimes/models.py
  52. +1 −0 tests/db_typecasts/tests.py
  53. +2 −1 tests/decorators/tests.py
  54. +4 −0 tests/defer/models.py
  55. +14 −0 tests/defer_regress/models.py
  56. +1 −0 tests/defer_regress/tests.py
  57. +6 −0 tests/delete/models.py
  58. +2 −1 tests/delete/tests.py
  59. +28 −0 tests/delete_regress/models.py
  60. +2 −1 tests/delete_regress/tests.py
  61. +5 −3 tests/dispatch/tests/test_dispatcher.py
  62. +4 −0 tests/dispatch/tests/test_saferef.py
  63. +5 −0 tests/distinct_on_fields/models.py
  64. +2 −1 tests/distinct_on_fields/tests.py
  65. +1 −0 tests/expressions/models.py
  66. +1 −0 tests/expressions_regress/models.py
  67. +35 −35 tests/expressions_regress/tests.py
  68. +2 −0 tests/extra_regress/models.py
  69. +2 −0 tests/field_subclassing/fields.py
  70. +2 −0 tests/field_subclassing/models.py
  71. +1 −0 tests/file_storage/models.py
  72. +5 −0 tests/file_storage/tests.py
  73. +2 −1 tests/file_uploads/tests.py
  74. +3 −1 tests/file_uploads/uploadhandler.py
  75. +10 −0 tests/file_uploads/views.py
  76. +8 −0 tests/fixtures/models.py
  77. +1 −0 tests/fixtures_model_package/models/__init__.py
  78. +1 −0 tests/fixtures_regress/models.py
  79. +4 −0 tests/force_insert_update/models.py
  80. +11 −0 tests/foreign_object/models.py
  81. +2 −0 tests/foreign_object/tests.py
  82. +4 −1 tests/forms_tests/models.py
  83. +1 −0 tests/forms_tests/tests/test_error_messages.py
  84. +3 −0 tests/forms_tests/tests/test_extra.py
  85. +5 −1 tests/forms_tests/tests/test_formsets.py
  86. +2 −0 tests/forms_tests/tests/test_input_formats.py
  87. +3 −1 tests/forms_tests/tests/test_widgets.py
  88. +1 −0 tests/forms_tests/tests/tests.py
  89. +1 −0 tests/generic_inline_admin/admin.py
  90. +2 −0 tests/generic_inline_admin/models.py
  91. +3 −0 tests/generic_inline_admin/tests.py
  92. +2 −0 tests/generic_relations/tests.py
  93. +25 −0 tests/generic_relations_regress/models.py
  94. +4 −0 tests/generic_views/models.py
  95. +1 −0 tests/generic_views/test_base.py
  96. +2 −1 tests/generic_views/test_dates.py
  97. +19 −0 tests/generic_views/views.py
  98. +2 −0 tests/get_object_or_404/models.py
  99. +2 −0 tests/get_or_create_regress/models.py
  100. +5 −0 tests/handlers/views.py
  101. +5 −0 tests/httpwrappers/tests.py
  102. +2 −0 tests/i18n/forms.py
  103. +1 −0 tests/i18n/models.py
  104. +12 −6 tests/i18n/test_extraction.py
  105. +3 −0 tests/i18n/tests.py
  106. +4 −0 tests/inline_formsets/models.py
  107. +6 −0 tests/inspectdb/models.py
  108. +2 −1 tests/inspectdb/tests.py
  109. +4 −0 tests/known_related_objects/models.py
  110. +1 −0 tests/known_related_objects/tests.py
  111. +2 −0 tests/logging_tests/tests.py
  112. +5 −0 tests/lookup/models.py
  113. +2 −0 tests/m2m_and_m2o/models.py
  114. +2 −1 tests/m2m_and_m2o/tests.py
  115. +2 −0 tests/m2m_intermediary/models.py
  116. +9 −0 tests/m2m_regress/models.py
  117. +3 −0 tests/m2m_signals/models.py
  118. +6 −0 tests/m2m_through/models.py
  119. +9 −0 tests/m2m_through_regress/models.py
  120. +1 −0 tests/m2o_recursive/models.py
  121. +1 −0 tests/m2o_recursive/tests.py
  122. +1 −0 tests/many_to_many/models.py
  123. +1 −0 tests/many_to_one/models.py
  124. +1 −0 tests/many_to_one_null/models.py
  125. +10 −1 tests/many_to_one_regress/models.py
  126. +1 −0 tests/max_lengths/models.py
  127. +1 −0 tests/max_lengths/tests.py
  128. +7 −5 tests/middleware/tests.py
  129. +2 −0 tests/middleware_exceptions/tests.py
  130. +6 −0 tests/middleware_exceptions/views.py
  131. +8 −0 tests/model_fields/tests.py
  132. +28 −0 tests/model_forms/models.py
  133. +8 −3 tests/model_forms/tests.py
  134. +12 −0 tests/model_forms_regress/models.py
  135. +6 −1 tests/model_forms_regress/tests.py
  136. +26 −0 tests/model_formsets/models.py
  137. +6 −0 tests/model_formsets_regress/models.py
  138. +1 −0 tests/model_formsets_regress/tests.py
  139. +22 −0 tests/model_inheritance/models.py
  140. +37 −0 tests/model_inheritance_regress/models.py
  141. +1 −0 tests/model_inheritance_same_model_name/models.py
  142. +2 −0 tests/model_inheritance_select_related/models.py
  143. +1 −0 tests/model_validation/models.py
  144. +3 −0 tests/modeladmin/models.py
  145. +6 −0 tests/multiple_database/models.py
  146. +117 −99 tests/multiple_database/tests.py
  147. +1 −0 tests/mutually_referential/models.py
  148. +2 −0 tests/nested_foreign_keys/models.py
  149. +7 −0 tests/null_fk/models.py
  150. +4 −0 tests/null_fk_ordering/models.py
  151. +5 −0 tests/null_queries/models.py
  152. +7 −2 tests/one_to_one/models.py
  153. +1 −0 tests/one_to_one/tests.py
  154. +2 −0 tests/order_with_respect_to/models.py
  155. +1 −0 tests/ordering/models.py
  156. +5 −0 tests/prefetch_related/models.py
  157. +2 −0 tests/proxy_model_inheritance/models.py
  158. +26 −0 tests/proxy_models/models.py
  159. +91 −0 tests/queries/models.py
  160. +31 −9 tests/queries/tests.py
  161. +6 −0 tests/queryset_pickle/models.py
  162. +4 −0 tests/raw_query/models.py
  163. +1 −0 tests/responses/tests.py
  164. +2 −0 tests/reverse_lookup/models.py
  165. +2 −0 tests/reverse_single_related/models.py
  166. +10 −0 tests/select_related/models.py
  167. +2 −0 tests/select_related_onetoone/models.py
  168. +28 −0 tests/select_related_regress/models.py
  169. +8 −4 tests/serializers/tests.py
  170. +63 −0 tests/serializers_regress/models.py
  171. +24 −0 tests/serializers_regress/tests.py
  172. +1 −0 tests/servers/tests.py
  173. +1 −0 tests/settings_tests/tests.py
  174. +1 −0 tests/signals/models.py
  175. +2 −0 tests/signals/tests.py
  176. +1 −0 tests/signals_regress/models.py
  177. +1 −0 tests/signing/tests.py
  178. +6 −0 tests/sites_framework/models.py
  179. +1 −0 tests/staticfiles_tests/storage.py
  180. +1 −0 tests/str/models.py
  181. +5 −0 tests/string_lookup/models.py
  182. +1 −0 tests/syndication/tests.py
  183. +4 −0 tests/tablespaces/models.py
  184. +2 −0 tests/tablespaces/tests.py
  185. +9 −4 tests/template_tests/filters.py
  186. +2 −0 tests/template_tests/templatetags/bad_tag.py
  187. +49 −0 tests/template_tests/templatetags/custom.py
  188. +1 −0 tests/template_tests/templatetags/subpackage/echo.py
  189. +1 −0 tests/template_tests/test_callables.py
  190. +7 −6 tests/template_tests/test_loaders.py
  191. +2 −1 tests/template_tests/test_nodelist.py
  192. +3 −2 tests/template_tests/test_response.py
  193. +1 −0 tests/template_tests/test_smartif.py
  194. +22 −9 tests/template_tests/tests.py
  195. +5 −0 tests/template_tests/views.py
  196. +3 −1 tests/test_client/tests.py
  197. +22 −0 tests/test_client/views.py
  198. +1 −0 tests/test_client_regress/session.py
  199. +22 −6 tests/test_client_regress/tests.py
  200. +18 −0 tests/test_client_regress/views.py
  201. +1 −0 tests/test_runner/models.py
  202. +1 −0 tests/test_runner_deprecation_app/tests.py
  203. +1 −0 tests/test_utils/models.py
  204. +2 −0 tests/timezones/admin.py
  205. +5 −0 tests/timezones/forms.py
  206. +6 −0 tests/timezones/models.py
  207. +11 −5 tests/transactions/tests.py
  208. +2 −0 tests/transactions_regress/models.py
  209. +4 −1 tests/transactions_regress/tests.py
  210. +12 −1 tests/unmanaged_models/models.py
  211. +4 −0 tests/update/models.py
  212. +1 −0 tests/update_only_fields/models.py
  213. +1 −0 tests/urlpatterns_reverse/erroneous_views_module.py
  214. +5 −0 tests/urlpatterns_reverse/middleware.py
  215. +11 −1 tests/urlpatterns_reverse/tests.py
  216. +1 −0 tests/urlpatterns_reverse/urlconf_inner.py
  217. +10 −0 tests/urlpatterns_reverse/views.py
  218. +1 −0 tests/user_commands/management/commands/leave_locale_alone_false.py
  219. +1 −0 tests/user_commands/management/commands/leave_locale_alone_true.py
  220. +1 −0 tests/utils_tests/test_baseconv.py
  221. +1 −0 tests/utils_tests/test_checksums.py
  222. +1 −0 tests/utils_tests/test_datetime_safe.py
  223. +1 −0 tests/utils_tests/test_decorators.py
  224. +1 −0 tests/utils_tests/test_ipv6.py
  225. +3 −0 tests/utils_tests/test_jslex.py
  226. +5 −0 tests/utils_tests/test_module_loading.py
  227. +1 −0 tests/utils_tests/test_simplelazyobject.py
  228. +1 −0 tests/utils_tests/test_text.py
  229. +5 −4 tests/utils_tests/test_tzinfo.py
  230. +13 −0 tests/validation/models.py
  231. +1 −0 tests/validation/test_unique.py
  232. +2 −1 tests/validation/tests.py
  233. +6 −4 tests/validators/tests.py
  234. +1 −0 tests/version/tests.py
  235. +1 −0 tests/view_tests/__init__.py
  236. +5 −0 tests/view_tests/models.py
  237. +1 −0 tests/view_tests/templatetags/debugtags.py
  238. +2 −1 tests/view_tests/tests/test_debug.py
  239. +1 −0 tests/view_tests/tests/test_shortcuts.py
  240. +32 −0 tests/view_tests/views.py
  241. +1 −0 tests/wsgi/urls.py
@@ -387,7 +387,8 @@ def render(self, name, value, attrs=None):
def value_from_datadict(self, data, files, name):
upload = super(ClearableFileInput, self).value_from_datadict(data, files, name)
if not self.is_required and CheckboxInput().value_from_datadict(
- data, files, self.clear_checkbox_name(name)):
+ data, files, self.clear_checkbox_name(name)):
+
if upload:
# If the user contradicts themselves (uploads a new file AND
# checks the "clear" checkbox), we return a unique marker
View
@@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh
[flake8]
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/*
-ignore=E124,E125,E127,E128,E226,E251,E302,E501,W601
+ignore=E124,E125,E127,E128,E226,E251,E501,W601
[metadata]
license-file = LICENSE
@@ -1,33 +1,40 @@
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
+
class Event(models.Model):
# Oracle can have problems with a column named "date"
date = models.DateField(db_column="event_date")
+
class Parent(models.Model):
name = models.CharField(max_length=128)
+
class Child(models.Model):
parent = models.ForeignKey(Parent, editable=False, null=True)
name = models.CharField(max_length=30, blank=True)
age = models.IntegerField(null=True, blank=True)
+
class Genre(models.Model):
name = models.CharField(max_length=20)
+
class Band(models.Model):
name = models.CharField(max_length=20)
nr_of_members = models.PositiveIntegerField()
genres = models.ManyToManyField(Genre)
+
@python_2_unicode_compatible
class Musician(models.Model):
name = models.CharField(max_length=30)
def __str__(self):
return self.name
+
@python_2_unicode_compatible
class Group(models.Model):
name = models.CharField(max_length=30)
@@ -36,26 +43,32 @@ class Group(models.Model):
def __str__(self):
return self.name
+
class Membership(models.Model):
music = models.ForeignKey(Musician)
group = models.ForeignKey(Group)
role = models.CharField(max_length=15)
+
class Quartet(Group):
pass
+
class ChordsMusician(Musician):
pass
+
class ChordsBand(models.Model):
name = models.CharField(max_length=30)
members = models.ManyToManyField(ChordsMusician, through='Invitation')
+
class Invitation(models.Model):
player = models.ForeignKey(ChordsMusician)
band = models.ForeignKey(ChordsBand)
instrument = models.CharField(max_length=15)
+
class Swallow(models.Model):
origin = models.CharField(max_length=255)
load = models.FloatField()
@@ -77,6 +90,7 @@ class OrderedObjectManager(models.Manager):
def get_queryset(self):
return super(OrderedObjectManager, self).get_queryset().order_by('number')
+
class OrderedObject(models.Model):
"""
Model with Manager that defines a default order.
@@ -88,5 +102,6 @@ class OrderedObject(models.Model):
objects = OrderedObjectManager()
+
class CustomIdUser(models.Model):
uuid = models.AutoField(primary_key=True)
@@ -54,6 +54,7 @@ def wrapper(*args, **kwargs):
class Person(models.Model):
name = models.CharField(max_length=20)
+
class PersonAdmin(admin.ModelAdmin):
def response_post_save_add(self, request, obj):
@@ -68,6 +69,7 @@ def response_post_save_change(self, request, obj):
class Car(models.Model):
name = models.CharField(max_length=20)
+
class CarAdmin(admin.ModelAdmin):
def response_add(self, request, obj, post_url_continue=None):
@@ -5,9 +5,11 @@
xview_dec = decorator_from_middleware(XViewMiddleware)
+
def xview(request):
return HttpResponse()
+
class XViewClass(View):
def get(self, request):
return HttpResponse()
@@ -27,6 +27,7 @@ class Department(models.Model):
def __str__(self):
return self.description
+
@python_2_unicode_compatible
class Employee(models.Model):
department = models.ForeignKey(Department, to_field="code")
@@ -153,6 +153,7 @@ class ChildModel1Inline(admin.TabularInline):
class ChildModel2Inline(admin.StackedInline):
model = ChildModel2
+
# admin for #19425 and #18388
class BinaryTreeAdmin(admin.TabularInline):
model = BinaryTree
@@ -169,10 +170,12 @@ def get_max_num(self, request, obj=None, **kwargs):
return max_num - obj.binarytree_set.count()
return max_num
+
# admin for #19524
class SightingInline(admin.TabularInline):
model = Sighting
+
# admin and form for #18263
class SomeChildModelForm(forms.ModelForm):
@@ -89,6 +89,7 @@ class Inner2(models.Model):
dummy = models.IntegerField()
holder = models.ForeignKey(Holder2)
+
class Holder3(models.Model):
dummy = models.IntegerField()
@@ -99,58 +100,72 @@ class Inner3(models.Model):
# Models for ticket #8190
+
class Holder4(models.Model):
dummy = models.IntegerField()
+
class Inner4Stacked(models.Model):
dummy = models.IntegerField(help_text="Awesome stacked help text is awesome.")
holder = models.ForeignKey(Holder4)
+
class Inner4Tabular(models.Model):
dummy = models.IntegerField(help_text="Awesome tabular help text is awesome.")
holder = models.ForeignKey(Holder4)
# Models for #12749
+
class Person(models.Model):
firstname = models.CharField(max_length=15)
+
class OutfitItem(models.Model):
name = models.CharField(max_length=15)
+
class Fashionista(models.Model):
person = models.OneToOneField(Person, primary_key=True)
weaknesses = models.ManyToManyField(OutfitItem, through='ShoppingWeakness', blank=True)
+
class ShoppingWeakness(models.Model):
fashionista = models.ForeignKey(Fashionista)
item = models.ForeignKey(OutfitItem)
# Models for #13510
+
class TitleCollection(models.Model):
pass
+
class Title(models.Model):
collection = models.ForeignKey(TitleCollection, blank=True, null=True)
title1 = models.CharField(max_length=100)
title2 = models.CharField(max_length=100)
# Models for #15424
+
class Poll(models.Model):
name = models.CharField(max_length=40)
+
class Question(models.Model):
poll = models.ForeignKey(Poll)
+
class Novel(models.Model):
name = models.CharField(max_length=40)
+
class Chapter(models.Model):
name = models.CharField(max_length=40)
novel = models.ForeignKey(Novel)
+
class FootNote(models.Model):
"""
Model added for ticket 19838
@@ -160,6 +175,7 @@ class FootNote(models.Model):
# Models for #16838
+
class CapoFamiglia(models.Model):
name = models.CharField(max_length=100)
@@ -211,12 +227,15 @@ class BinaryTree(models.Model):
# Models for #19524
+
class LifeForm(models.Model):
pass
+
class ExtraTerrestrial(LifeForm):
name = models.CharField(max_length=100)
+
class Sighting(models.Model):
et = models.ForeignKey(ExtraTerrestrial)
place = models.CharField(max_length=100)
@@ -234,9 +253,11 @@ class SomeChildModel(models.Model):
# Other models
+
class ProfileCollection(models.Model):
pass
+
class Profile(models.Model):
collection = models.ForeignKey(ProfileCollection, blank=True, null=True)
first_name = models.CharField(max_length=100)
@@ -279,6 +279,7 @@ def test_all_inline_media(self):
self.assertContains(response, 'my_awesome_admin_scripts.js')
self.assertContains(response, 'my_awesome_inline_scripts.js')
+
class TestInlineAdminForm(TestCase):
urls = "admin_inlines.urls"
@@ -465,9 +466,9 @@ def test_inline_change_fk_add_perm(self):
self.assertContains(response, 'Add another Inner2')
# 3 extra forms only, not the existing instance form
self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
- 'value="3" name="inner2_set-TOTAL_FORMS" />', html=True)
+ 'value="3" name="inner2_set-TOTAL_FORMS" />', html=True)
self.assertNotContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
- 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
+ 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
def test_inline_change_fk_change_perm(self):
permission = Permission.objects.get(codename='change_inner2', content_type=self.inner_ct)
@@ -477,12 +478,12 @@ def test_inline_change_fk_change_perm(self):
self.assertContains(response, '<h2>Inner2s</h2>')
# Just the one form for existing instances
self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
- 'value="1" name="inner2_set-TOTAL_FORMS" />', html=True)
+ 'value="1" name="inner2_set-TOTAL_FORMS" />', html=True)
self.assertContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
- 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
+ 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
# max-num 0 means we can't add new ones
self.assertContains(response, '<input type="hidden" id="id_inner2_set-MAX_NUM_FORMS" '
- 'value="0" name="inner2_set-MAX_NUM_FORMS" />', html=True)
+ 'value="0" name="inner2_set-MAX_NUM_FORMS" />', html=True)
def test_inline_change_fk_add_change_perm(self):
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):
self.assertContains(response, '<h2>Inner2s</h2>')
# One form for existing instance and three extra for new
self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
- 'value="4" name="inner2_set-TOTAL_FORMS" />', html=True)
+ 'value="4" name="inner2_set-TOTAL_FORMS" />', html=True)
self.assertContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
- 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
+ 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
def test_inline_change_fk_change_del_perm(self):
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):
self.assertContains(response, '<h2>Inner2s</h2>')
# One form for existing instance only, no new
self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
- 'value="1" name="inner2_set-TOTAL_FORMS" />', html=True)
+ 'value="1" name="inner2_set-TOTAL_FORMS" />', html=True)
self.assertContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
- 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
+ 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
self.assertContains(response, 'id="id_inner2_set-0-DELETE"')
def test_inline_change_fk_all_perms(self):
@@ -525,9 +526,9 @@ def test_inline_change_fk_all_perms(self):
self.assertContains(response, '<h2>Inner2s</h2>')
# One form for existing instance only, three for new
self.assertContains(response, '<input type="hidden" id="id_inner2_set-TOTAL_FORMS" '
- 'value="4" name="inner2_set-TOTAL_FORMS" />', html=True)
+ 'value="4" name="inner2_set-TOTAL_FORMS" />', html=True)
self.assertContains(response, '<input type="hidden" id="id_inner2_set-0-id" '
- 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
+ 'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
self.assertContains(response, 'id="id_inner2_set-0-DELETE"')
@@ -698,5 +699,6 @@ def test_alternating_rows(self):
class SeleniumChromeTests(SeleniumFirefoxTests):
webdriver_class = 'selenium.webdriver.chrome.webdriver.WebDriver'
+
class SeleniumIETests(SeleniumFirefoxTests):
webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver'
@@ -11,6 +11,7 @@ class Band(models.Model):
class Meta:
ordering = ('name',)
+
class Song(models.Model):
band = models.ForeignKey(Band)
name = models.CharField(max_length=100)
@@ -20,13 +21,16 @@ class Song(models.Model):
class Meta:
ordering = ('name',)
+
class SongInlineDefaultOrdering(admin.StackedInline):
model = Song
+
class SongInlineNewOrdering(admin.StackedInline):
model = Song
ordering = ('duration', )
+
class DynOrderingBandAdmin(admin.ModelAdmin):
def get_ordering(self, request):
@@ -12,6 +12,7 @@
class MockRequest(object):
pass
+
class MockSuperUser(object):
def has_perm(self, perm):
return True
Oops, something went wrong. Retry.

0 comments on commit 7288e1b

Please sign in to comment.