Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Repaired an admin list_filter test that wasn't testing anything special.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16704 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ce477f0873331653bbcf4bcd66a06240071a5b34 1 parent 0f8f468
@jphalip jphalip authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 tests/regressiontests/admin_filters/tests.py
View
8 tests/regressiontests/admin_filters/tests.py
@@ -7,7 +7,8 @@
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.contrib.admin.views.main import ChangeList
-from django.contrib.admin import site, ModelAdmin, SimpleListFilter
+from django.contrib.admin import (site, ModelAdmin, SimpleListFilter,
+ BooleanFieldListFilter)
from models import Book
@@ -67,6 +68,9 @@ class BookAdmin(ModelAdmin):
list_filter = ('year', 'author', 'contributors', 'is_best_seller', 'date_registered', 'no')
ordering = ('-id',)
+class BookAdminWithTupleBooleanFilter(BookAdmin):
+ list_filter = ('year', 'author', 'contributors', ('is_best_seller', BooleanFieldListFilter), 'date_registered', 'no')
+
class DecadeFilterBookAdmin(ModelAdmin):
list_filter = ('author', DecadeListFilterWithTitleAndParameter)
ordering = ('-id',)
@@ -331,7 +335,7 @@ def test_booleanfieldlistfilter(self):
self.verify_booleanfieldlistfilter(modeladmin)
def test_booleanfieldlistfilter_tuple(self):
- modeladmin = BookAdmin(Book, site)
+ modeladmin = BookAdminWithTupleBooleanFilter(Book, site)
self.verify_booleanfieldlistfilter(modeladmin)
def verify_booleanfieldlistfilter(self, modeladmin):
Please sign in to comment.
Something went wrong with that request. Please try again.