mirror of
https://github.com/django/django.git
synced 2025-11-25 21:22:14 +00:00
Fixed #29703 -- Deprecated QuerySetPaginator alias.
Unused since 4406d283e1.
This commit is contained in:
parent
44f98f7880
commit
ed4bfacb3c
4 changed files with 22 additions and 2 deletions
|
|
@ -2,10 +2,11 @@ import warnings
|
|||
from datetime import datetime
|
||||
|
||||
from django.core.paginator import (
|
||||
EmptyPage, InvalidPage, PageNotAnInteger, Paginator,
|
||||
EmptyPage, InvalidPage, PageNotAnInteger, Paginator, QuerySetPaginator,
|
||||
UnorderedObjectListWarning,
|
||||
)
|
||||
from django.test import SimpleTestCase, TestCase
|
||||
from django.utils.deprecation import RemovedInDjango31Warning
|
||||
|
||||
from .custom import ValidAdjacentNumsPaginator
|
||||
from .models import Article
|
||||
|
|
@ -297,6 +298,12 @@ class PaginationTests(SimpleTestCase):
|
|||
with self.assertRaises(EmptyPage):
|
||||
paginator.get_page(1)
|
||||
|
||||
def test_querysetpaginator_deprecation(self):
|
||||
msg = 'The QuerySetPaginator alias of Paginator is deprecated.'
|
||||
with self.assertWarnsMessage(RemovedInDjango31Warning, msg) as cm:
|
||||
QuerySetPaginator([], 1)
|
||||
self.assertEqual(cm.filename, __file__)
|
||||
|
||||
|
||||
class ModelPaginationTests(TestCase):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue