summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Jesaitis <andrew@andrewjesaitis.com>2013-03-18 14:29:37 -0600
committerClaude Paroz <claude@2xlibre.net>2013-05-25 16:27:26 +0200
commit31f6421b134e4e83a459d2faa1009b33fefd6276 (patch)
tree60c56f3665a64c574fac1c908e26b890355ed6ca /tests
parent2ee447fb5f8974b432d3dd421af9a242215aea44 (diff)
Fixed #19938 -- Consumed iterator only once in paginator's Page
Thanks Joshua Fialkoff for the report.
Diffstat (limited to 'tests')
-rw-r--r--tests/pagination/tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/pagination/tests.py b/tests/pagination/tests.py
index dea5756672..1dea4526e3 100644
--- a/tests/pagination/tests.py
+++ b/tests/pagination/tests.py
@@ -297,6 +297,7 @@ class ModelPaginationTests(TestCase):
self.assertIsNone(p.object_list._result_cache)
self.assertRaises(TypeError, lambda: p['has_previous'])
self.assertIsNone(p.object_list._result_cache)
+ self.assertNotIsInstance(p.object_list, list)
# Make sure slicing the Page object with numbers and slice objects work.
self.assertEqual(p[0], Article.objects.get(headline='Article 1'))
@@ -305,3 +306,5 @@ class ModelPaginationTests(TestCase):
"<Article: Article 2>",
]
)
+ # After __getitem__ is called, object_list is a list
+ self.assertIsInstance(p.object_list, list)