diff options
author | Nick Pope <nick.pope@flightdataservices.com> | 2018-12-01 23:46:28 +0000 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2019-01-14 14:35:41 -0500 |
commit | c690afb873cac8035a3cb3be7c597a5ff0e4b261 (patch) | |
tree | 19d60b4ceaf53f86a9c1ba37b7e27ac080256f13 /tests/aggregation_regress | |
parent | 3d5e0f8394688d40036e27cfcfac295e6fe62269 (diff) | |
download | django-c690afb873cac8035a3cb3be7c597a5ff0e4b261.tar.gz |
Refs #28643 -- Changed Avg() to use NumericOutputFieldMixin.
Keeps precision instead of forcing DecimalField to FloatField.
Diffstat (limited to 'tests/aggregation_regress')
-rw-r--r-- | tests/aggregation_regress/tests.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py index 2b3948a0b4..64bbc13f80 100644 --- a/tests/aggregation_regress/tests.py +++ b/tests/aggregation_regress/tests.py @@ -401,7 +401,7 @@ class AggregationTests(TestCase): When(pages__lt=400, then='discount_price'), output_field=DecimalField() )))['test'], - 22.27, places=2 + Decimal('22.27'), places=2 ) def test_distinct_conditional_aggregate(self): @@ -1041,7 +1041,7 @@ class AggregationTests(TestCase): books = Book.objects.values_list("publisher__name").annotate( Count("id"), Avg("price"), Avg("authors__age"), avg_pgs=Avg("pages") ).order_by("-publisher__name") - self.assertEqual(books[0], ('Sams', 1, 23.09, 45.0, 528.0)) + self.assertEqual(books[0], ('Sams', 1, Decimal('23.09'), 45.0, 528.0)) def test_annotation_disjunction(self): qs = Book.objects.annotate(n_authors=Count("authors")).filter( |