diff options
Diffstat (limited to 'tests/postgres_tests')
| -rw-r--r-- | tests/postgres_tests/test_aggregates.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_aggregates.py b/tests/postgres_tests/test_aggregates.py index ae386b6659..621fa43d91 100644 --- a/tests/postgres_tests/test_aggregates.py +++ b/tests/postgres_tests/test_aggregates.py @@ -364,6 +364,18 @@ class TestGeneralAggregate(PostgreSQLTestCase): [[], [], [], []], ) + def test_array_agg_with_order_by_outer_ref(self): + StatTestModel.objects.annotate( + atm_ids=Subquery( + AggregateTestModel.objects.annotate( + ids=ArrayAgg( + "id", + order_by=[OuterRef("int1")], + ) + ).values("ids")[:1] + ) + ) + def test_bit_and_general(self): values = AggregateTestModel.objects.filter(integer_field__in=[0, 1]).aggregate( bitand=BitAnd("integer_field") |
