mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
[1.1.X] Fixed #7777 -- Added validation handling for NaN, Inf and -Inf in DecimalFields. Thanks to thebitguru for the patch.
Backport of r12490 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -320,6 +320,18 @@ True
|
||||
True
|
||||
>>> f.clean(Decimal('3.14')) == Decimal("3.14")
|
||||
True
|
||||
>>> f.clean('NaN')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValidationError: [u'Enter a number.']
|
||||
>>> f.clean('Inf')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValidationError: [u'Enter a number.']
|
||||
>>> f.clean('-Inf')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValidationError: [u'Enter a number.']
|
||||
>>> f.clean('a')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user