1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #28917 -- Prevented Paginator's unordered warning on EmptyQuerySet.

Thanks carltongibson for the idea and weijunji for the initial patch.
This commit is contained in:
Josh Schneier
2018-07-15 17:47:17 -04:00
committed by Tim Graham
parent 93e721a0b8
commit 4d48ddd8f9
3 changed files with 12 additions and 1 deletions

View File

@@ -2024,6 +2024,9 @@ class QuerysetOrderedTests(unittest.TestCase):
def test_explicit_ordering(self):
self.assertIs(Annotation.objects.all().order_by('id').ordered, True)
def test_empty_queryset(self):
self.assertIs(Annotation.objects.none().ordered, True)
def test_order_by_extra(self):
self.assertIs(Annotation.objects.all().extra(order_by=['id']).ordered, True)