Added sorting to some admin_view tests to prevent transient failures; refs #23380.

This commit is contained in:
Tim Graham 2014-09-08 17:10:58 -04:00
parent 16548cfc7c
commit d3543af750
1 changed files with 3 additions and 3 deletions

View File

@ -438,7 +438,7 @@ class ListFiltersTests(TestCase):
# Make sure that all users are present in the contrib's list filter
filterspec = changelist.get_filters(request)[0][2]
expected = [(self.alfred.pk, 'alfred'), (self.bob.pk, 'bob'), (self.lisa.pk, 'lisa')]
self.assertEqual(filterspec.lookup_choices, expected)
self.assertEqual(sorted(filterspec.lookup_choices), sorted(expected))
request = self.request_factory.get('/', {'contributors__isnull': 'True'})
changelist = self.get_changelist(request, Book, modeladmin)
@ -526,7 +526,7 @@ class ListFiltersTests(TestCase):
# Make sure that only actual authors are present in author's list filter
filterspec = changelist.get_filters(request)[0][4]
expected = [(self.alfred.pk, 'alfred'), (self.bob.pk, 'bob')]
self.assertEqual(filterspec.lookup_choices, expected)
self.assertEqual(sorted(filterspec.lookup_choices), sorted(expected))
def test_relatedonlyfieldlistfilter_manytomany(self):
modeladmin = BookAdminRelatedOnlyFilter(Book, site)
@ -537,7 +537,7 @@ class ListFiltersTests(TestCase):
# Make sure that only actual contributors are present in contrib's list filter
filterspec = changelist.get_filters(request)[0][5]
expected = [(self.bob.pk, 'bob'), (self.lisa.pk, 'lisa')]
self.assertEqual(filterspec.lookup_choices, expected)
self.assertEqual(sorted(filterspec.lookup_choices), sorted(expected))
def test_booleanfieldlistfilter(self):
modeladmin = BookAdmin(Book, site)