mirror of
https://github.com/django/django.git
synced 2025-11-20 03:30:00 +00:00
Fixed #32116 -- Fixed QuerySet.order_by() crash on EmptyQuerySet with union() on a single non-empty ordered queryset.
This commit is contained in:
parent
4e4db426c5
commit
c7c7615d00
2 changed files with 10 additions and 1 deletions
|
|
@ -106,6 +106,11 @@ class QuerySetSetOperationTests(TestCase):
|
|||
self.assertEqual(len(qs2.union(qs2)), 0)
|
||||
self.assertEqual(len(qs3.union(qs3)), 0)
|
||||
|
||||
def test_empty_qs_union_with_ordered_qs(self):
|
||||
qs1 = Number.objects.all().order_by('num')
|
||||
qs2 = Number.objects.none().union(qs1).order_by('num')
|
||||
self.assertEqual(list(qs1), list(qs2))
|
||||
|
||||
def test_limits(self):
|
||||
qs1 = Number.objects.all()
|
||||
qs2 = Number.objects.all()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue