summaryrefslogtreecommitdiff
path: root/tests/regressiontests/model_fields/tests.py
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2009-02-11 20:14:24 +0000
committerBrian Rosner <brosner@gmail.com>2009-02-11 20:14:24 +0000
commit5db8dc357323c1b87c8b110f25d3dbadeaa47c4e (patch)
tree5120d4fa51e188d7bf1b71073868d33e05ceacb9 /tests/regressiontests/model_fields/tests.py
parentc2838753894cbed7ee73c0fa85efa6b87c605598 (diff)
[1.0.X] Fixed #5903 -- DecimalField.get_default() now correctly returns a Decimal object when the model instance was not retrieved from the database. Thanks Justin Driscoll and pigletto.
Backport of r9823 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9824 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/model_fields/tests.py')
-rw-r--r--tests/regressiontests/model_fields/tests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py
index 80ff4bada6..b1a572844f 100644
--- a/tests/regressiontests/model_fields/tests.py
+++ b/tests/regressiontests/model_fields/tests.py
@@ -20,6 +20,10 @@ Traceback (most recent call last):
...
ValidationError: This value must be a decimal number.
+>>> f = DecimalField(default=Decimal("0.00"))
+>>> f.get_default()
+Decimal("0.00")
+
>>> f = DecimalField(max_digits=5, decimal_places=1)
>>> x = f.to_python(2)
>>> y = f.to_python('2.6')