Refs #28643 -- Changed Variance() to use NumericOutputFieldMixin.

Keeps precision instead of forcing DecimalField to FloatField.
This commit is contained in:
Nick Pope 2018-12-19 23:04:25 +00:00 committed by Tim Graham
parent e85afa5943
commit 6d4efa8e6a
4 changed files with 10 additions and 10 deletions

View file

@ -1160,7 +1160,7 @@ class AggregationTests(TestCase):
self.assertEqual(
Book.objects.aggregate(Variance('price')),
{'price__variance': Approximate(583.77, 1)}
{'price__variance': Approximate(Decimal('583.77'), 1)}
)
self.assertEqual(
@ -1175,7 +1175,7 @@ class AggregationTests(TestCase):
self.assertEqual(
Book.objects.aggregate(Variance('price', sample=True)),
{'price__variance': Approximate(700.53, 2)}
{'price__variance': Approximate(Decimal('700.53'), 2)}
)
def test_filtering_by_annotation_name(self):