From f88fc72da4eb76f2d464edb4874ef6046f8a8658 Mon Sep 17 00:00:00 2001 From: Alexander Kerkum Date: Fri, 16 Sep 2022 16:47:50 +0200 Subject: Fixed #34016 -- Fixed QuerySet.values()/values_list() crash on ArrayAgg() and JSONBAgg(). Regression in e06dc4571ea9fd5723c8029959b95808be9f8812. --- tests/postgres_tests/test_aggregates.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/postgres_tests') diff --git a/tests/postgres_tests/test_aggregates.py b/tests/postgres_tests/test_aggregates.py index c2f38e42b6..9cca121802 100644 --- a/tests/postgres_tests/test_aggregates.py +++ b/tests/postgres_tests/test_aggregates.py @@ -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 -- cgit v1.3