mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #32812 -- Restored immutability of named values from QuerySet.values_list().
Regression in 981a072dd4.
Thanks pirelle for the report.
This commit is contained in:
committed by
Mariusz Felisiak
parent
f10c52afab
commit
0393b9262d
@@ -309,6 +309,13 @@ class PrefetchRelatedTests(TestDataMixin, TestCase):
|
||||
list(Book.objects.prefetch_related(relation))
|
||||
self.assertEqual(add_q_mock.call_count, 1)
|
||||
|
||||
def test_named_values_list(self):
|
||||
qs = Author.objects.prefetch_related('books')
|
||||
self.assertCountEqual(
|
||||
[value.name for value in qs.values_list('name', named=True)],
|
||||
['Anne', 'Charlotte', 'Emily', 'Jane'],
|
||||
)
|
||||
|
||||
|
||||
class RawQuerySetTests(TestDataMixin, TestCase):
|
||||
def test_basic(self):
|
||||
|
||||
Reference in New Issue
Block a user