summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-03 02:02:41 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-03 02:02:41 +0000
commit2542b94fb214847af0a4e1eca84558debbf32ee2 (patch)
tree468947f006dcb4bb44d5a23b1c85e2308dab79c1 /tests/regressiontests
parentf467c8cbc133bd4300961226ccced499fb8a485e (diff)
Fixed #6465 -- Tweaked MergeDict.getlist() to work with Django's MultiValueDict class. Thanks, Matt McClanahan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7062 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/datastructures/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py
index 3b0ccde257..b5dc5d171b 100644
--- a/tests/regressiontests/datastructures/tests.py
+++ b/tests/regressiontests/datastructures/tests.py
@@ -20,6 +20,19 @@
>>> md2['chris']
'cool'
+MergeDict can merge MultiValueDicts
+>>> multi1 = MultiValueDict({'key1': ['value1'], 'key2': ['value2', 'value3']})
+>>> multi2 = MultiValueDict({'key2': ['value4'], 'key4': ['value5', 'value6']})
+>>> mm = MergeDict(multi1, multi2)
+
+# Although 'key2' appears in both dictionaries, only the first value is used.
+>>> mm.getlist('key2')
+['value2', 'value3']
+>>> mm.getlist('key4')
+['value5', 'value6']
+>>> mm.getlist('undefined')
+[]
+
### MultiValueDict ##########################################################
>>> d = MultiValueDict({'name': ['Adrian', 'Simon'], 'position': ['Developer']})