mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #23190 -- Made Paginator.page_range an iterator
This commit is contained in:
parent
fd869cceac
commit
b91a2a499f
5 changed files with 29 additions and 3 deletions
|
@ -233,6 +233,12 @@ class PaginationTests(unittest.TestCase):
|
|||
self.assertEqual(page2.previous_page_number(), 1)
|
||||
self.assertIsNone(page2.next_page_number())
|
||||
|
||||
def test_page_range_iterator(self):
|
||||
"""
|
||||
Paginator.page_range should be an iterator.
|
||||
"""
|
||||
self.assertIsInstance(Paginator([1, 2, 3], 2).page_range, type(six.moves.range(0)))
|
||||
|
||||
|
||||
class ModelPaginationTests(TestCase):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue