mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +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:
parent
f10c52afab
commit
0393b9262d
5 changed files with 25 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue