mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #3293 -- newforms: Changed IntegerField.clean() to return None if field is not required and empty. Thanks, Honza Kral
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4312 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -810,9 +810,11 @@ ValidationError: [u'Enter a whole number.']
|
||||
|
||||
>>> f = IntegerField(required=False)
|
||||
>>> f.clean('')
|
||||
u''
|
||||
>>> repr(f.clean(''))
|
||||
'None'
|
||||
>>> f.clean(None)
|
||||
u''
|
||||
>>> repr(f.clean(None))
|
||||
'None'
|
||||
>>> f.clean('1')
|
||||
1
|
||||
>>> isinstance(f.clean('1'), int)
|
||||
|
||||
Reference in New Issue
Block a user