summaryrefslogtreecommitdiff
path: root/tests/regressiontests/datastructures
diff options
context:
space:
mode:
authorJeremy Dunck <jdunck@gmail.com>2007-12-01 22:12:44 +0000
committerJeremy Dunck <jdunck@gmail.com>2007-12-01 22:12:44 +0000
commit23384af79b2f43f08e8395d0a84a57c2a98df392 (patch)
tree77e45f0e0fc6cb9b3380982313f45febf2ebf6f0 /tests/regressiontests/datastructures
parent85ce45bc441e4ace2fba83bc2d2432e22ec9da94 (diff)
gis: Merged 6672-6783 vis svnmerge from trunk
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6815 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/datastructures')
-rw-r--r--tests/regressiontests/datastructures/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py
index d1e21e673c..3b0ccde257 100644
--- a/tests/regressiontests/datastructures/tests.py
+++ b/tests/regressiontests/datastructures/tests.py
@@ -25,11 +25,23 @@
>>> d = MultiValueDict({'name': ['Adrian', 'Simon'], 'position': ['Developer']})
>>> d['name']
'Simon'
+>>> d.get('name')
+'Simon'
>>> d.getlist('name')
['Adrian', 'Simon']
+>>> d['lastname']
+Traceback (most recent call last):
+...
+MultiValueDictKeyError: "Key 'lastname' not found in <MultiValueDict: {'position': ['Developer'], 'name': ['Adrian', 'Simon']}>"
+>>> d.get('lastname')
+
>>> d.get('lastname', 'nonexistent')
'nonexistent'
+>>> d.getlist('lastname')
+[]
>>> d.setlist('lastname', ['Holovaty', 'Willison'])
+>>> d.getlist('lastname')
+['Holovaty', 'Willison']
### SortedDict #################################################################