From 6d256ae248cfa1f111d03d29402a669a95cdff3c Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Mon, 4 Aug 2014 16:54:43 +0200 Subject: [PATCH] Fixed test failures from 98e8da3709e400d549e87c7ff1450a2685c0adcf. --- tests/admin_filters/tests.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/admin_filters/tests.py b/tests/admin_filters/tests.py index dccd2e3b5f..fcd7038687 100644 --- a/tests/admin_filters/tests.py +++ b/tests/admin_filters/tests.py @@ -373,7 +373,8 @@ class ListFiltersTests(TestCase): # Make sure that all users are present in the author's list filter filterspec = changelist.get_filters(request)[0][1] - self.assertEqual(filterspec.lookup_choices, [(1, 'alfred'), (2, 'bob'), (3, 'lisa')]) + expected = [(self.alfred.pk, 'alfred'), (self.bob.pk, 'bob'), (self.lisa.pk, 'lisa')] + self.assertEqual(filterspec.lookup_choices, expected) request = self.request_factory.get('/', {'author__isnull': 'True'}) changelist = self.get_changelist(request, Book, modeladmin) @@ -408,7 +409,8 @@ class ListFiltersTests(TestCase): # Make sure that all users are present in the contrib's list filter filterspec = changelist.get_filters(request)[0][2] - self.assertEqual(filterspec.lookup_choices, [(1, 'alfred'), (2, 'bob'), (3, 'lisa')]) + expected = [(self.alfred.pk, 'alfred'), (self.bob.pk, 'bob'), (self.lisa.pk, 'lisa')] + self.assertEqual(filterspec.lookup_choices, expected) request = self.request_factory.get('/', {'contributors__isnull': 'True'}) changelist = self.get_changelist(request, Book, modeladmin) @@ -495,7 +497,8 @@ class ListFiltersTests(TestCase): # Make sure that only actual authors are present in author's list filter filterspec = changelist.get_filters(request)[0][4] - self.assertEqual(filterspec.lookup_choices, [(1, 'alfred'), (2, 'bob')]) + expected = [(self.alfred.pk, 'alfred'), (self.bob.pk, 'bob')] + self.assertEqual(filterspec.lookup_choices, expected) def test_relatedonlyfieldlistfilter_manytomany(self): modeladmin = BookAdminRelatedOnlyFilter(Book, site) @@ -505,7 +508,8 @@ class ListFiltersTests(TestCase): # Make sure that only actual contributors are present in contrib's list filter filterspec = changelist.get_filters(request)[0][5] - self.assertEqual(filterspec.lookup_choices, [(2, 'bob'), (3, 'lisa')]) + expected = [(self.bob.pk, 'bob'), (self.lisa.pk, 'lisa')] + self.assertEqual(filterspec.lookup_choices, expected) def test_booleanfieldlistfilter(self): modeladmin = BookAdmin(Book, site)