summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-05-13 18:45:16 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-05-13 18:45:16 +0000
commitf4fce99bc1247f333c4093f3cfa077f7acd8d541 (patch)
tree989391ffabf7c393a5c94baad9835f91ad2d0289 /tests
parent11d08bca2bf99de7e7aefec7986a206ea5039724 (diff)
downloaddjango-f4fce99bc1247f333c4093f3cfa077f7acd8d541.tar.gz
[1.0.X] Fixed #10687: fixed request parsing when upload_handlers is empty. Thanks, Armin Ronacher. Backport of [10723] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10765 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/file_uploads/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/file_uploads/tests.py b/tests/regressiontests/file_uploads/tests.py
index df60d0de99..e4945175b9 100644
--- a/tests/regressiontests/file_uploads/tests.py
+++ b/tests/regressiontests/file_uploads/tests.py
@@ -3,12 +3,14 @@ import os
import errno
import shutil
import unittest
+from StringIO import StringIO
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase, client
from django.utils import simplejson
from django.utils.hashcompat import sha_constructor
+from django.http.multipartparser import MultiPartParser
from models import FileModel, temp_storage, UPLOAD_TO
import uploadhandler
@@ -294,3 +296,13 @@ class DirectoryCreationTests(unittest.TestCase):
"%s exists and is not a directory." % UPLOAD_TO)
except:
self.fail("IOError not raised")
+
+class MultiParserTests(unittest.TestCase):
+
+ def test_empty_upload_handlers(self):
+ # We're not actually parsing here; just checking if the parser properly
+ # instantiates with empty upload handlers.
+ parser = MultiPartParser({
+ 'CONTENT_TYPE': 'multipart/form-data; boundary=_foo',
+ 'CONTENT_LENGTH': '1'
+ }, StringIO('x'), [], 'utf-8')