From cbbd54d5cda576f0d604ef519b078fdc585d4f5a Mon Sep 17 00:00:00 2001 From: Gary Wilson Jr Date: Sat, 2 Aug 2008 04:48:14 +0000 Subject: Fixed #7920 -- Made tests compatible with Python 2.6's Decimal repr change, patch from Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8190 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/model_fields/tests.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/regressiontests/model_fields') diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py index ff0df80067..5aedcd15fc 100644 --- a/tests/regressiontests/model_fields/tests.py +++ b/tests/regressiontests/model_fields/tests.py @@ -1,15 +1,19 @@ """ >>> from django.db.models.fields import * +>>> try: +... from decimal import Decimal +... except ImportError: +... from django.utils._decimal import Decimal # DecimalField >>> f = DecimalField(max_digits=4, decimal_places=2) ->>> f.to_python(3) -Decimal("3") +>>> f.to_python(3) == Decimal("3") +True ->>> f.to_python("3.14") -Decimal("3.14") +>>> f.to_python("3.14") == Decimal("3.14") +True >>> f.to_python("abc") Traceback (most recent call last): -- cgit v1.3