summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms/tests.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-15 10:12:05 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-15 10:12:05 +0000
commitf0cd172cd0bccc519a6ecdf41b6a10b46ccffbcf (patch)
tree062ffc271ea2f0c1e308f5e1245129efff856dba /tests/regressiontests/forms/tests.py
parent32ed883861ecded14e51dd8b72d097bc37572c6c (diff)
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
Diffstat (limited to 'tests/regressiontests/forms/tests.py')
-rw-r--r--tests/regressiontests/forms/tests.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py
index fef8361a14..b85897897f 100644
--- a/tests/regressiontests/forms/tests.py
+++ b/tests/regressiontests/forms/tests.py
@@ -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__ = {