Running with Python 2.5 (or lower) and MySQL (or Postgres or Oracle), failure is:
======================================================================
FAIL: Doctest: modeltests.aggregation.models.__test__.API_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kmt/django/trunk/django/test/_doctest.py", line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for modeltests.aggregation.models.__test__.API_TESTS
File "/home/kmt/django/trunk/tests/modeltests/aggregation/models.py", line unknown line number, in API_TESTS
----------------------------------------------------------------------
File "/home/kmt/django/trunk/tests/modeltests/aggregation/models.py", line ?, in modeltests.aggregation.models.__test__.
API_TESTS
Failed example:
Book.objects.values_list('price').annotate(count=Count('price')).order_by('-count', 'price')
Expected:
[(Decimal('29.69'), 2), (Decimal('23.09'), 1), (Decimal('30'), 1), (Decimal('75'), 1), (Decimal('82.8'), 1)]
Got:
[(Decimal("29.69"), 2), (Decimal("23.09"), 1), (Decimal("30.00"), 1), (Decimal("75.00"), 1), (Decimal("82.80"), 1)]
----------------------------------------------------------------------
Ran 1 test in 1.683s
FAILED (failures=1)
Decimal repr changed to use single quotes in Python 2.6, and these other DBs apparently consistently return two digits after the decimal place, even when they are 0.
I messed this one up, apparently the diferent backends return different precision decimal bits. this fixes.