mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Refs #28643 -- Changed Variance() to use NumericOutputFieldMixin.
Keeps precision instead of forcing DecimalField to FloatField.
This commit is contained in:
parent
e85afa5943
commit
6d4efa8e6a
4 changed files with 10 additions and 10 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue