From a616b9217408d57650fbb5a3d9e211d9a7f8ac6d Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Tue, 8 Jul 2008 05:28:37 +0000 Subject: [PATCH] Fixed test suite after [7687]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7868 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/pagination/models.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/modeltests/pagination/models.py b/tests/modeltests/pagination/models.py index 1f08a32903..4b564f2f90 100644 --- a/tests/modeltests/pagination/models.py +++ b/tests/modeltests/pagination/models.py @@ -31,7 +31,7 @@ __test__ = {'API_TESTS':""" # New/current API (Paginator/Page) # #################################### ->>> from django.core.paginator import Paginator, InvalidPage +>>> from django.core.paginator import Paginator >>> paginator = Paginator(Article.objects.all(), 5) >>> paginator.count 9 @@ -82,15 +82,15 @@ True >>> p.end_index() 9 -# Invalid pages raise InvalidPage. +# Empty pages raise EmptyPage. >>> paginator.page(0) Traceback (most recent call last): ... -InvalidPage: ... +EmptyPage: ... >>> paginator.page(3) Traceback (most recent call last): ... -InvalidPage: ... +EmptyPage: ... # Empty paginators with allow_empty_first_page=True. >>> paginator = Paginator(Article.objects.filter(id=0), 5, allow_empty_first_page=True) @@ -148,7 +148,7 @@ True >>> from warnings import filterwarnings >>> filterwarnings("ignore") ->>> from django.core.paginator import ObjectPaginator, InvalidPage +>>> from django.core.paginator import ObjectPaginator, EmptyPage >>> paginator = ObjectPaginator(Article.objects.all(), 5) >>> paginator.hits 9 @@ -181,15 +181,15 @@ True >>> paginator.last_on_page(1) 9 -# Invalid pages raise InvalidPage. +# Invalid pages raise EmptyPage. >>> paginator.get_page(-1) Traceback (most recent call last): ... -InvalidPage: ... +EmptyPage: ... >>> paginator.get_page(2) Traceback (most recent call last): ... -InvalidPage: ... +EmptyPage: ... # Empty paginators with allow_empty_first_page=True. >>> paginator = ObjectPaginator(Article.objects.filter(id=0), 5)