From 0ab570217a07726426fd6728c472093a87df691f Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Wed, 15 Aug 2012 14:58:43 +0200 Subject: [PATCH] [py3] Fixed paginator tests. --- tests/modeltests/pagination/tests.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/modeltests/pagination/tests.py b/tests/modeltests/pagination/tests.py index cba8825ec4..12ce0e3ecb 100644 --- a/tests/modeltests/pagination/tests.py +++ b/tests/modeltests/pagination/tests.py @@ -28,7 +28,7 @@ class PaginationTests(TestCase): paginator = Paginator(Article.objects.all(), 5) self.assertEqual(9, paginator.count) self.assertEqual(2, paginator.num_pages) - self.assertEqual([1, 2], paginator.page_range) + self.assertEqual([1, 2], list(paginator.page_range)) def test_first_page(self): paginator = Paginator(Article.objects.all(), 5) @@ -78,13 +78,13 @@ class PaginationTests(TestCase): paginator = Paginator(Article.objects.filter(id=0), 5, allow_empty_first_page=True) self.assertEqual(0, paginator.count) self.assertEqual(1, paginator.num_pages) - self.assertEqual([1], paginator.page_range) + self.assertEqual([1], list(paginator.page_range)) # Empty paginators with allow_empty_first_page=False. paginator = Paginator(Article.objects.filter(id=0), 5, allow_empty_first_page=False) self.assertEqual(0, paginator.count) self.assertEqual(0, paginator.num_pages) - self.assertEqual([], paginator.page_range) + self.assertEqual([], list(paginator.page_range)) def test_invalid_page(self): paginator = Paginator(Article.objects.all(), 5) @@ -108,7 +108,7 @@ class PaginationTests(TestCase): paginator = Paginator([1, 2, 3, 4, 5, 6, 7, 8, 9], 3) self.assertEqual(9, paginator.count) self.assertEqual(3, paginator.num_pages) - self.assertEqual([1, 2, 3], paginator.page_range) + self.assertEqual([1, 2, 3], list(paginator.page_range)) p = paginator.page(2) self.assertEqual("", six.text_type(p)) self.assertEqual([4, 5, 6], p.object_list) @@ -125,10 +125,10 @@ class PaginationTests(TestCase): paginator = Paginator(CountContainer(), 10) self.assertEqual(42, paginator.count) self.assertEqual(5, paginator.num_pages) - self.assertEqual([1, 2, 3, 4, 5], paginator.page_range) + self.assertEqual([1, 2, 3, 4, 5], list(paginator.page_range)) # Paginator can be passed other objects that implement __len__. paginator = Paginator(LenContainer(), 10) self.assertEqual(42, paginator.count) self.assertEqual(5, paginator.num_pages) - self.assertEqual([1, 2, 3, 4, 5], paginator.page_range) + self.assertEqual([1, 2, 3, 4, 5], list(paginator.page_range))