mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #2070: refactored Django's file upload capabilities.
A description of the new features can be found in the new [http://www.djangoproject.com/documentation/upload_handing/ upload handling documentation]; the executive summary is that Django will now happily handle uploads of large files without issues. This changes the representation of uploaded files from dictionaries to bona fide objects; see BackwardsIncompatibleChanges for details. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7814 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
tests = r"""
|
||||
>>> from django.newforms import *
|
||||
>>> from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
|
||||
# CharField ###################################################################
|
||||
|
||||
@@ -214,11 +215,11 @@ ValidationError: [u'REQUIRED']
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValidationError: [u'INVALID']
|
||||
>>> f.clean({})
|
||||
>>> f.clean(SimpleUploadedFile('name', None))
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValidationError: [u'MISSING']
|
||||
>>> f.clean({'filename': 'name', 'content':''})
|
||||
ValidationError: [u'EMPTY FILE']
|
||||
>>> f.clean(SimpleUploadedFile('name', ''))
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValidationError: [u'EMPTY FILE']
|
||||
|
||||
Reference in New Issue
Block a user