diff options
author | Nicolas NoƩ <nicolas@niconoe.eu> | 2018-05-09 09:16:28 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-05-09 09:23:05 -0400 |
commit | 2134e7d4391c2279f6cfddadc2a0c1195cec16e4 (patch) | |
tree | 6e12dad58c76d7c46b5b85cb5d99577c7126746d /tests/pagination | |
parent | 3574a6d32fcd88d404b110a8d2204db1dd14a545 (diff) | |
download | django-2134e7d4391c2279f6cfddadc2a0c1195cec16e4.tar.gz |
Refs #29389 -- Added Paginator test for float page number.
Diffstat (limited to 'tests/pagination')
-rw-r--r-- | tests/pagination/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/pagination/tests.py b/tests/pagination/tests.py index 05fad4f67c..5c2e7db197 100644 --- a/tests/pagination/tests.py +++ b/tests/pagination/tests.py @@ -120,6 +120,12 @@ class PaginationTests(unittest.TestCase): paginator.validate_number(None) with self.assertRaises(PageNotAnInteger): paginator.validate_number('x') + + def test_float_integer_page(self): + paginator = Paginator([1, 2, 3], 2) + self.assertEqual(paginator.validate_number(1.0), 1) + + def test_no_content_allow_empty_first_page(self): # With no content and allow_empty_first_page=True, 1 is a valid page number paginator = Paginator([], 2) self.assertEqual(paginator.validate_number(1), 1) |