diff options
| author | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-07-30 17:25:35 +0000 |
|---|---|---|
| committer | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-07-30 17:25:35 +0000 |
| commit | f27774ee0ab4b2537909d642c23ea6ae6ea8d166 (patch) | |
| tree | 2a5ff32cbff0bf26b2e005fd6d2ee6c21dadb542 /tests/regressiontests | |
| parent | d76e5320772686dfc120fe0e32cc816504bf7fb5 (diff) | |
Fixed call to `ugettext`, which is imported as `_`.
Changed raise to conform to PEP 3109 and wrapped the long line.
Added beginnings of tests for model fields.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/model_fields/__init__.py | 0 | ||||
| -rw-r--r-- | tests/regressiontests/model_fields/models.py | 0 | ||||
| -rw-r--r-- | tests/regressiontests/model_fields/tests.py | 18 |
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/regressiontests/model_fields/__init__.py b/tests/regressiontests/model_fields/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/regressiontests/model_fields/__init__.py diff --git a/tests/regressiontests/model_fields/models.py b/tests/regressiontests/model_fields/models.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/regressiontests/model_fields/models.py 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.'] +""" |
