diff options
| author | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-11-30 06:23:24 +0000 |
|---|---|---|
| committer | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-11-30 06:23:24 +0000 |
| commit | c81b01e060ad80a5c4df579a96ff737df2d336b3 (patch) | |
| tree | d34a873e7b5e19f0e91424d4ab28e2f968233d63 /tests/regressiontests/datastructures | |
| parent | f88babafc58eafece72d3f2f7444336c69196808 (diff) | |
newforms-admin: Merged from trunk up to [6775].
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/datastructures')
| -rw-r--r-- | tests/regressiontests/datastructures/tests.py | 12 |
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 ################################################################# |
