Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.'] | ||
""" |