summaryrefslogtreecommitdiff
path: root/tests/regressiontests/datastructures
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2008-02-08 20:57:56 +0000
committerJustin Bronn <jbronn@gmail.com>2008-02-08 20:57:56 +0000
commitd06e33a54d93c35584c348b286b6fea4ffdd3868 (patch)
tree0cfb5088ec0d9c12df3afce8b85c5c48730e961f /tests/regressiontests/datastructures
parent40e0a964ea0eab8353a338d5527988f09a0d6e51 (diff)
gis: Merged revisions 7044-7102 via svnmerge from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7103 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/datastructures')
-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']})