mirror of https://github.com/django/django.git
[1.9.x] Fixed admin_filters test failures when run in reverse.
Backport of b1b14587ae
from master
This commit is contained in:
parent
fe79bc3ed9
commit
a58150df3f
|
@ -909,7 +909,7 @@ class ListFiltersTests(TestCase):
|
|||
"""
|
||||
|
||||
modeladmin = DepartmentFilterEmployeeAdmin(Employee, site)
|
||||
request = self.request_factory.get('/', {'department': self.john.pk})
|
||||
request = self.request_factory.get('/', {'department': self.john.department.pk})
|
||||
changelist = self.get_changelist(request, Employee, modeladmin)
|
||||
|
||||
queryset = changelist.get_queryset(request)
|
||||
|
@ -921,7 +921,7 @@ class ListFiltersTests(TestCase):
|
|||
choices = list(filterspec.choices(changelist))
|
||||
self.assertEqual(choices[1]['display'], 'DEV')
|
||||
self.assertEqual(choices[1]['selected'], True)
|
||||
self.assertEqual(choices[1]['query_string'], '?department=%s' % self.john.pk)
|
||||
self.assertEqual(choices[1]['query_string'], '?department=%s' % self.john.department.pk)
|
||||
|
||||
def test_lookup_with_non_string_value_underscored(self):
|
||||
"""
|
||||
|
@ -930,7 +930,7 @@ class ListFiltersTests(TestCase):
|
|||
Refs #19182
|
||||
"""
|
||||
modeladmin = DepartmentFilterUnderscoredEmployeeAdmin(Employee, site)
|
||||
request = self.request_factory.get('/', {'department__whatever': self.john.pk})
|
||||
request = self.request_factory.get('/', {'department__whatever': self.john.department.pk})
|
||||
changelist = self.get_changelist(request, Employee, modeladmin)
|
||||
|
||||
queryset = changelist.get_queryset(request)
|
||||
|
@ -942,7 +942,7 @@ class ListFiltersTests(TestCase):
|
|||
choices = list(filterspec.choices(changelist))
|
||||
self.assertEqual(choices[1]['display'], 'DEV')
|
||||
self.assertEqual(choices[1]['selected'], True)
|
||||
self.assertEqual(choices[1]['query_string'], '?department__whatever=%s' % self.john.pk)
|
||||
self.assertEqual(choices[1]['query_string'], '?department__whatever=%s' % self.john.department.pk)
|
||||
|
||||
def test_fk_with_to_field(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue