mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #30572 -- Prevented values()/values_list() on combined queryset from mutating the list of columns in querysets.
This commit is contained in:
parent
a7038adbd0
commit
14d026cccb
2 changed files with 4 additions and 0 deletions
|
|
@ -123,6 +123,9 @@ class QuerySetSetOperationTests(TestCase):
|
|||
self.assertEqual(reserved_name['order'], 2)
|
||||
reserved_name = qs1.union(qs1).values_list('name', 'order', 'id').get()
|
||||
self.assertEqual(reserved_name[:2], ('a', 2))
|
||||
# List of columns can be changed.
|
||||
reserved_name = qs1.union(qs1).values_list('order').get()
|
||||
self.assertEqual(reserved_name, (2,))
|
||||
|
||||
def test_union_with_two_annotated_values_list(self):
|
||||
qs1 = Number.objects.filter(num=1).annotate(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue