mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #29694 -- Fixed column mismatch crash with QuerySet.values() or values_list() after combining querysets with extra() with union(), difference(), or intersection().
Regression in 0b66c3b442.
This commit is contained in:
@@ -130,6 +130,13 @@ class QuerySetSetOperationTests(TestCase):
|
||||
).values_list('num', 'count')
|
||||
self.assertCountEqual(qs1.union(qs2), [(1, 0), (2, 1)])
|
||||
|
||||
def test_union_with_extra_and_values_list(self):
|
||||
qs1 = Number.objects.filter(num=1).extra(
|
||||
select={'count': 0},
|
||||
).values_list('num', 'count')
|
||||
qs2 = Number.objects.filter(num=2).extra(select={'count': 1})
|
||||
self.assertCountEqual(qs1.union(qs2), [(1, 0), (2, 1)])
|
||||
|
||||
def test_union_with_values_list_on_annotated_and_unannotated(self):
|
||||
ReservedName.objects.create(name='rn1', order=1)
|
||||
qs1 = Number.objects.annotate(
|
||||
|
||||
Reference in New Issue
Block a user