mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #34024 -- Fixed crash when aggregating querysets with Q objects annotations.
This reverts b64db05b9c.
It was reasonable to assume it was unnecessary code as there were
no failing tests upon its removal. This commit adds the necessary
regression tests for the failing condition identified in #34024
alongside the original tests added in the PR for which
WhereNode.is_summary was introduced.
This commit is contained in:
@@ -554,6 +554,9 @@ class AggregationTests(TestCase):
|
||||
325,
|
||||
)
|
||||
|
||||
def test_q_annotation_aggregate(self):
|
||||
self.assertEqual(Book.objects.annotate(has_pk=Q(pk__isnull=False)).count(), 6)
|
||||
|
||||
def test_decimal_aggregate_annotation_filter(self):
|
||||
"""
|
||||
Filtering on an aggregate annotation with Decimal values should work.
|
||||
|
||||
Reference in New Issue
Block a user