diff options
| author | Alexander Kerkum <alex.kerkum@waarneming.nl> | 2022-09-16 16:47:50 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-09-17 19:38:20 +0200 |
| commit | f88fc72da4eb76f2d464edb4874ef6046f8a8658 (patch) | |
| tree | 8a891bf5c8d2877dbb0565c8792665b96d9ce3d0 /tests/postgres_tests | |
| parent | ae509f8f0804dea0eea89e27329014616c9d4cc0 (diff) | |
Fixed #34016 -- Fixed QuerySet.values()/values_list() crash on ArrayAgg() and JSONBAgg().
Regression in e06dc4571ea9fd5723c8029959b95808be9f8812.
Diffstat (limited to 'tests/postgres_tests')
| -rw-r--r-- | tests/postgres_tests/test_aggregates.py | 9 |
1 files changed, 9 insertions, 0 deletions
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 |
