1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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):