Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed test suite after [7687].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7868 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a616b9217408d57650fbb5a3d9e211d9a7f8ac6d 1 parent a724fff
Malcolm Tredinnick malcolmt authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 tests/modeltests/pagination/models.py
16 tests/modeltests/pagination/models.py
View
@@ -31,7 +31,7 @@ def __unicode__(self):
# 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 @@ def __unicode__(self):
>>> 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 @@ def __unicode__(self):
>>> 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 @@ def __unicode__(self):
>>> 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)
Please sign in to comment.
Something went wrong with that request. Please try again.