summaryrefslogtreecommitdiff
path: root/tests/regressiontests/datastructures/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/datastructures/tests.py')
-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 #################################################################