1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #5387 -- Added is_multipart method to forms. Original patch from Petr Marhhoun. Tests and documentation from Murkt.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6273 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2007-09-15 10:12:05 +00:00
parent 32ed883861
commit f0cd172cd0
5 changed files with 53 additions and 0 deletions

View File

@@ -3856,6 +3856,25 @@ u'sirrobin'
<div class="errorlist"><div class="error">This field is required.</div></div>
<p>Comment: <input type="text" name="comment" /></p>
#################################
# Test multipart-encoded form #
#################################
>>> class FormWithoutFile(Form):
... username = CharField()
>>> class FormWithFile(Form):
... username = CharField()
... file = FileField()
>>> class FormWithImage(Form):
... image = ImageField()
>>> FormWithoutFile().is_multipart()
False
>>> FormWithFile().is_multipart()
True
>>> FormWithImage().is_multipart()
True
"""
__test__ = {