summaryrefslogtreecommitdiff
path: root/tests/regressiontests/model_fields
diff options
context:
space:
mode:
authorGary Wilson Jr <gary.wilson@gmail.com>2008-08-02 04:48:14 +0000
committerGary Wilson Jr <gary.wilson@gmail.com>2008-08-02 04:48:14 +0000
commitcbbd54d5cda576f0d604ef519b078fdc585d4f5a (patch)
tree51827a6cf3af45c4f5b7999e8f2ffc3f671a9aa9 /tests/regressiontests/model_fields
parenta500ade891c5f2b3e5f7502b6fb121bc733dd0b5 (diff)
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
Diffstat (limited to 'tests/regressiontests/model_fields')
-rw-r--r--tests/regressiontests/model_fields/tests.py12
1 files changed, 8 insertions, 4 deletions
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):