#14246 closed (fixed)
aggregation_regress tests don't run on Postgres that supports StdDev
| Reported by: | Karen Tracey | Owned by: | nobody |
|---|---|---|---|
| Component: | Uncategorized | Version: | 1.2 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Since being refactored unit tests (r13614/r13615), aggregation_regress tests fail on sufficiently high levels of Postgres:
Creating table aggregation_regress_hardbackbook
Installing custom SQL ...
Installing indexes ...
Installed 25 object(s) from 1 fixture(s)
test_aggrate_annotation (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_aggregate (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_aggregate_fexpr (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_aggregates_in_where_clause (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_aggregates_in_where_clause_pre_eval (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_annotate_with_extra (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_annotation (regressiontests.aggregation_regress.tests.AggregationTests) ... FAIL
test_db_col_table (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_empty (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_field_error (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_more (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_more_more (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_more_more_more (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_pickle (regressiontests.aggregation_regress.tests.AggregationTests) ... ok
test_stddev (regressiontests.aggregation_regress.tests.AggregationTests) ... ERROR
======================================================================
ERROR: test_stddev (regressiontests.aggregation_regress.tests.AggregationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kmtracey/django/hgclone/tests/regressiontests/aggregation_regress/tests.py", line 625, in test_stddev
Book.objects.aggregate(StdDev('pages')),
NameError: global name 'StdDev' is not defined
======================================================================
FAIL: test_annotation (regressiontests.aggregation_regress.tests.AggregationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kmtracey/django/hgclone/tests/regressiontests/aggregation_regress/tests.py", line 145, in test_annotation
rating=3.0
File "/home/kmtracey/django/hgclone/tests/regressiontests/aggregation_regress/tests.py", line 35, in assertObjectAttrs
self.assertEqual(getattr(obj, attr), value)
AssertionError: Decimal('11.545') != 11.545
----------------------------------------------------------------------
Ran 15 tests in 0.342s
FAILED (failures=1, errors=1)
Destroying test database 'default'...
Destroying test database 'other'...
Partial fix attached, which imports StdDev and Variance and sprinkles Approximate as needed. It would be good if someone who understands how Approximate is supposed to be used took a look, since it's not immediately obvious to me...the values supplied for places here are sometimes smaller than I would have thought they should be, but they are what is needed to get the tests to pass on my machine.
Also still needed is understanding of the test_annotation failure.
Attachments (1)
Change History (4)
by , 15 years ago
| Attachment: | aggregation_regress.diff added |
|---|
comment:1 by , 15 years ago
comment:2 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
(In [13710]) [1.2.X] Fixed some of the problems with aggregation_regress tests on higher levles of Postgres. Refs #14246.
r13709 from trunk.