diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-06-19 10:44:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-19 10:44:53 +0200 |
| commit | 14d026cccb144c6877294ba4cd4e03ebf0842498 (patch) | |
| tree | b3f2ad248aec2b040a5860e6ddc4c27db4329b5b /tests | |
| parent | a7038adbd02c916315b16939b835f021c2ee8880 (diff) | |
Fixed #30572 -- Prevented values()/values_list() on combined queryset from mutating the list of columns in querysets.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/queries/test_qs_combinators.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py index 3902db59e2..227972e8c4 100644 --- a/tests/queries/test_qs_combinators.py +++ b/tests/queries/test_qs_combinators.py @@ -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( |
