diff options
Diffstat (limited to 'tests/regressiontests/model_fields/tests.py')
| -rw-r--r-- | tests/regressiontests/model_fields/tests.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py new file mode 100644 index 0000000000..e279a0669f --- /dev/null +++ b/tests/regressiontests/model_fields/tests.py @@ -0,0 +1,18 @@ +""" +>>> from django.db.models.fields import * + +# DecimalField + +>>> f = DecimalField() + +>>> f.to_python(3) +Decimal("3") + +>>> f.to_python("3.14") +Decimal("3.14") + +>>> f.to_python("abc") +Traceback (most recent call last): +... +ValidationError: [u'This value must be a decimal number.'] +""" |
