mirror of
https://github.com/django/django.git
synced 2025-10-06 16:50:52 +00:00
[4.1.x] Fixed #34016 -- Fixed QuerySet.values()/values_list() crash on ArrayAgg() and JSONBAgg().
Regression ine06dc4571e
. Backport off88fc72da4
from main
This commit is contained in:
parent
0859093f7c
commit
2d20386b41
3 changed files with 18 additions and 2 deletions
|
@ -686,6 +686,15 @@ class TestGeneralAggregate(PostgreSQLTestCase):
|
|||
],
|
||||
)
|
||||
|
||||
def test_values_list(self):
|
||||
tests = [ArrayAgg("integer_field"), JSONBAgg("integer_field")]
|
||||
for aggregation in tests:
|
||||
with self.subTest(aggregation=aggregation):
|
||||
self.assertCountEqual(
|
||||
AggregateTestModel.objects.values_list(aggregation),
|
||||
[([0],), ([1],), ([2],), ([0],)],
|
||||
)
|
||||
|
||||
|
||||
class TestAggregateDistinct(PostgreSQLTestCase):
|
||||
@classmethod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue