Django

Code

Changeset 6715

Show
Ignore:
Timestamp:
11/25/07 12:16:40 (10 months ago)
Author:
gwilson
Message:

Added a few more tests for MultiValueDict.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/datastructures/tests.py

    r6593 r6715  
    2626>>> d['name'] 
    2727'Simon' 
     28>>> d.get('name') 
     29'Simon' 
    2830>>> d.getlist('name') 
    2931['Adrian', 'Simon'] 
     32>>> d['lastname'] 
     33Traceback (most recent call last): 
     34... 
     35MultiValueDictKeyError: "Key 'lastname' not found in <MultiValueDict: {'position': ['Developer'], 'name': ['Adrian', 'Simon']}>" 
     36>>> d.get('lastname') 
     37 
    3038>>> d.get('lastname', 'nonexistent') 
    3139'nonexistent' 
     40>>> d.getlist('lastname') 
     41[] 
    3242>>> d.setlist('lastname', ['Holovaty', 'Willison']) 
     43>>> d.getlist('lastname') 
     44['Holovaty', 'Willison'] 
    3345 
    3446### SortedDict #################################################################