diff options
Diffstat (limited to 'tests/pagination')
| -rw-r--r-- | tests/pagination/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/pagination/tests.py b/tests/pagination/tests.py index f13afc308f..987e713405 100644 --- a/tests/pagination/tests.py +++ b/tests/pagination/tests.py @@ -1,4 +1,5 @@ import unittest +import warnings from datetime import datetime from django.core.paginator import ( @@ -368,6 +369,11 @@ class ModelPaginationTests(TestCase): # is appropriate). self.assertEqual(cm.filename, __file__) + def test_paginating_empty_queryset_does_not_warn(self): + with warnings.catch_warnings(record=True) as recorded: + Paginator(Article.objects.none(), 5) + self.assertEqual(len(recorded), 0) + def test_paginating_unordered_object_list_raises_warning(self): """ Unordered object list warning with an object that has an orderd |
