summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/forms/forms.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/regressiontests/forms/forms.py b/tests/regressiontests/forms/forms.py
index d834bdaccc..76132b273f 100644
--- a/tests/regressiontests/forms/forms.py
+++ b/tests/regressiontests/forms/forms.py
@@ -540,8 +540,9 @@ zero-based index.
<li><label for="composers_id_1"><input type="checkbox" name="composers" value="P" id="composers_id_1" /> Paul McCartney</label></li>
</ul>
-Data for a MultipleChoiceField should be a list. QueryDict and MultiValueDict
-conveniently work with this.
+Data for a MultipleChoiceField should be a list. QueryDict, MultiValueDict and
+MergeDict (when created as a merge of MultiValueDicts) conveniently work with
+this.
>>> data = {'name': 'Yesterday', 'composers': ['J', 'P']}
>>> f = SongForm(data)
>>> f.errors
@@ -556,6 +557,11 @@ conveniently work with this.
>>> f = SongForm(data)
>>> f.errors
{}
+>>> from django.utils.datastructures import MergeDict
+>>> data = MergeDict(MultiValueDict(dict(name=['Yesterday'], composers=['J', 'P'])))
+>>> f = SongForm(data)
+>>> f.errors
+{}
The MultipleHiddenInput widget renders multiple values as hidden fields.
>>> class SongFormHidden(Form):