mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +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:
@@ -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__ = {
|
||||
|
||||
Reference in New Issue
Block a user