Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed some of the problems with aggregation_regress tests on higher l…

…evles of Postgres. Refs: #14246.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13709 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 30ad3537184fb8db8051b91b060c50ad73b53b7e 1 parent 3061071
@kmtracey kmtracey authored
Showing with 13 additions and 13 deletions.
  1. +13 −13 tests/regressiontests/aggregation_regress/tests.py
View
26 tests/regressiontests/aggregation_regress/tests.py
@@ -5,7 +5,7 @@
from django.conf import settings
from django.test import TestCase, Approximate
from django.db import DEFAULT_DB_ALIAS
-from django.db.models import Count, Max, Avg, Sum, F
+from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F
from regressiontests.aggregation_regress.models import *
@@ -623,60 +623,60 @@ def test_more_more_more(self):
def test_stddev(self):
self.assertEqual(
Book.objects.aggregate(StdDev('pages')),
- {'pages__stddev': 311.46}
+ {'pages__stddev': Approximate(311.46, 1)}
)
self.assertEqual(
Book.objects.aggregate(StdDev('rating')),
- {'rating__stddev': 0.60}
+ {'rating__stddev': Approximate(0.60, 1)}
)
self.assertEqual(
Book.objects.aggregate(StdDev('price')),
- {'price__stddev': 24.16}
+ {'price__stddev': Approximate(24.16, 2)}
)
self.assertEqual(
Book.objects.aggregate(StdDev('pages', sample=True)),
- {'pages__stddev': 341.19}
+ {'pages__stddev': Approximate(341.19, 2)}
)
self.assertEqual(
Book.objects.aggregate(StdDev('rating', sample=True)),
- {'rating__stddev': 0.66}
+ {'rating__stddev': Approximate(0.66, 2)}
)
self.assertEqual(
Book.objects.aggregate(StdDev('price', sample=True)),
- {'price__stddev': 26.46}
+ {'price__stddev': Approximate(26.46, 1)}
)
self.assertEqual(
Book.objects.aggregate(Variance('pages')),
- {'pages__variance': 97010.80}
+ {'pages__variance': Approximate(97010.80, 1)}
)
self.assertEqual(
Book.objects.aggregate(Variance('rating')),
- {'rating__variance': 0.36}
+ {'rating__variance': Approximate(0.36, 1)}
)
self.assertEqual(
Book.objects.aggregate(Variance('price')),
- {'price__variance': 583.77}
+ {'price__variance': Approximate(583.77, 1)}
)
self.assertEqual(
Book.objects.aggregate(Variance('pages', sample=True)),
- {'pages__variance': 116412.96}
+ {'pages__variance': Approximate(116412.96, 1)}
)
self.assertEqual(
Book.objects.aggregate(Variance('rating', sample=True)),
- {'rating__variance': 0.44}
+ {'rating__variance': Approximate(0.44, 2)}
)
self.assertEqual(
Book.objects.aggregate(Variance('price', sample=True)),
- {'price__variance': 700.53}
+ {'price__variance': Approximate(700.53, 2)}
)
Please sign in to comment.
Something went wrong with that request. Please try again.