1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #13689 -- Convert the per_page value to an integer upon initialization of the Paginator class to prevent unpleasant TypeErrors. Thanks, rbanffy, Eric Florenzano and Claude Paroz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-04-22 12:03:03 +00:00
parent e744fec8f9
commit 0e9692bc66
2 changed files with 7 additions and 2 deletions

View File

@@ -94,6 +94,11 @@ class PaginatorTests(TestCase):
(([1, 2], 1, 1, True), (2, 1, [1])),
(([1, 2, 3], 2, 1, True), (3, 1, [1])),
((eleven, 10, 1, True), (11, 1, [1])),
# Non-integer inputs
((ten, '4', 1, False), (10, 3, [1, 2, 3])),
((ten, u'4', 1, False), (10, 3, [1, 2, 3])),
((ten, 4, '1', False), (10, 3, [1, 2, 3])),
((ten, 4, u'1', False), (10, 3, [1, 2, 3])),
)
for params, output in tests:
self.check_paginator(params, output)