1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #29389 -- Made Paginator reject non-integer page numbers of type float.

This commit is contained in:
Nicolas Noé
2018-05-09 12:25:39 +02:00
committed by Tim Graham
parent 2134e7d439
commit c629d4e956
2 changed files with 4 additions and 0 deletions

View File

@@ -120,6 +120,8 @@ class PaginationTests(unittest.TestCase):
paginator.validate_number(None)
with self.assertRaises(PageNotAnInteger):
paginator.validate_number('x')
with self.assertRaises(PageNotAnInteger):
paginator.validate_number(1.2)
def test_float_integer_page(self):
paginator = Paginator([1, 2, 3], 2)