diff --git a/tests/modeltests/pagination/models.py b/tests/modeltests/pagination/models.py
index 1f08a32..fe2e71a 100644
a
|
b
|
__test__ = {'API_TESTS':"""
|
31 | 31 | # New/current API (Paginator/Page) # |
32 | 32 | #################################### |
33 | 33 | |
34 | | >>> from django.core.paginator import Paginator, InvalidPage |
| 34 | >>> from django.core.paginator import Paginator, EmptyPage |
35 | 35 | >>> paginator = Paginator(Article.objects.all(), 5) |
36 | 36 | >>> paginator.count |
37 | 37 | 9 |
… |
… |
True
|
82 | 82 | >>> p.end_index() |
83 | 83 | 9 |
84 | 84 | |
85 | | # Invalid pages raise InvalidPage. |
| 85 | # Invalid pages raise EmptyPage. |
86 | 86 | >>> paginator.page(0) |
87 | 87 | Traceback (most recent call last): |
88 | 88 | ... |
89 | | InvalidPage: ... |
| 89 | EmptyPage: ... |
90 | 90 | >>> paginator.page(3) |
91 | 91 | Traceback (most recent call last): |
92 | 92 | ... |
93 | | InvalidPage: ... |
| 93 | EmptyPage: ... |
94 | 94 | |
95 | 95 | # Empty paginators with allow_empty_first_page=True. |
96 | 96 | >>> paginator = Paginator(Article.objects.filter(id=0), 5, allow_empty_first_page=True) |
… |
… |
True
|
148 | 148 | >>> from warnings import filterwarnings |
149 | 149 | >>> filterwarnings("ignore") |
150 | 150 | |
151 | | >>> from django.core.paginator import ObjectPaginator, InvalidPage |
| 151 | >>> from django.core.paginator import ObjectPaginator, EmptyPage |
152 | 152 | >>> paginator = ObjectPaginator(Article.objects.all(), 5) |
153 | 153 | >>> paginator.hits |
154 | 154 | 9 |
… |
… |
True
|
181 | 181 | >>> paginator.last_on_page(1) |
182 | 182 | 9 |
183 | 183 | |
184 | | # Invalid pages raise InvalidPage. |
| 184 | # Invalid pages raise EmptyPage. |
185 | 185 | >>> paginator.get_page(-1) |
186 | 186 | Traceback (most recent call last): |
187 | 187 | ... |
188 | | InvalidPage: ... |
| 188 | EmptyPage: ... |
189 | 189 | >>> paginator.get_page(2) |
190 | 190 | Traceback (most recent call last): |
191 | 191 | ... |
192 | | InvalidPage: ... |
| 192 | EmptyPage: ... |
193 | 193 | |
194 | 194 | # Empty paginators with allow_empty_first_page=True. |
195 | 195 | >>> paginator = ObjectPaginator(Article.objects.filter(id=0), 5) |