mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #30446 -- Resolved Value.output_field for stdlib types.
This required implementing a limited form of dynamic dispatch to combine expressions with numerical output. Refs #26355 should eventually provide a better interface for that.
This commit is contained in:
committed by
Mariusz Felisiak
parent
d08e6f55e3
commit
1e38f1191d
@@ -388,7 +388,7 @@ class AggregationTests(TestCase):
|
||||
)
|
||||
|
||||
def test_annotated_conditional_aggregate(self):
|
||||
annotated_qs = Book.objects.annotate(discount_price=F('price') * 0.75)
|
||||
annotated_qs = Book.objects.annotate(discount_price=F('price') * Decimal('0.75'))
|
||||
self.assertAlmostEqual(
|
||||
annotated_qs.aggregate(test=Avg(Case(
|
||||
When(pages__lt=400, then='discount_price'),
|
||||
|
||||
Reference in New Issue
Block a user