diff options
Diffstat (limited to 'tests/aggregation')
| -rw-r--r-- | tests/aggregation/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index af6c660cf1..b01df88109 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -2315,3 +2315,9 @@ class AggregateAnnotationPruningTests(TestCase): max_book_author=Max("book__authors"), ).aggregate(count=Count("id", filter=Q(id=F("max_book_author")))) self.assertEqual(aggregates, {"count": 1}) + + def test_aggregate_reference_lookup_rhs_iter(self): + aggregates = Author.objects.annotate( + max_book_author=Max("book__authors"), + ).aggregate(count=Count("id", filter=Q(id__in=[F("max_book_author"), 0]))) + self.assertEqual(aggregates, {"count": 1}) |
