Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.2.X] Fixed some of the problems with aggregation_regress tests on …

…higher levles of Postgres. Refs #14246.

r13709 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13710 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1b0084e2a046f6cca03ef68f72e34e9b0544ae60 1 parent ec4d6bb
@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.