diff options
author | Nick Pope <nick.pope@flightdataservices.com> | 2018-08-22 19:40:14 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-08-27 16:23:43 -0400 |
commit | ed4bfacb3c942d0d32795e1a733b1b9367afd2e9 (patch) | |
tree | 9a75d8337cc33a2e2bb4b6b325e8287d77ecbd82 /tests/pagination | |
parent | 44f98f78804627839d5f0a8b3a32bfbb4546ff52 (diff) | |
download | django-ed4bfacb3c942d0d32795e1a733b1b9367afd2e9.tar.gz |
Fixed #29703 -- Deprecated QuerySetPaginator alias.
Unused since 4406d283e13819b04556df21044089b7d119edb0.
Diffstat (limited to 'tests/pagination')
-rw-r--r-- | tests/pagination/tests.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/pagination/tests.py b/tests/pagination/tests.py index 8ab04940ab..20e74981cd 100644 --- a/tests/pagination/tests.py +++ b/tests/pagination/tests.py @@ -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): """ |