Django

Code

Changeset 4684

Show
Ignore:
Timestamp:
03/08/07 03:28:45 (2 years ago)
Author:
mtredinnick
Message:

Fixed #3616 -- Added some more data structure tests from Chris McAvoy?.

Files:

Legend:

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

    r4640 r4684  
    3232>>> d.setlist('lastname', ['Holovaty', 'Willison']) 
    3333 
     34### SortedDict ################################################################# 
     35 
     36>>> d = SortedDict() 
     37>>> d['one'] = 'one' 
     38>>> d['two'] = 'two' 
     39>>> d['three'] = 'three' 
     40>>> d['one'] 
     41'one' 
     42>>> d['two'] 
     43'two' 
     44>>> d['three'] 
     45'three' 
     46>>> d.keys() 
     47['one', 'two', 'three'] 
     48>>> d.values() 
     49['one', 'two', 'three'] 
     50>>> d['one'] = 'not one' 
     51>>> d['one'] 
     52'not one' 
     53 
     54### DotExpandedDict ############################################################ 
     55 
     56>>> d = DotExpandedDict({'person.1.firstname': ['Simon'], 'person.1.lastname': ['Willison'], 'person.2.firstname': ['Adrian'], 'person.2.lastname': ['Holovaty']}) 
     57>>> d['person']['1']['lastname'] 
     58['Willison'] 
     59>>> d['person']['2']['lastname'] 
     60['Holovaty'] 
     61>>> d['person']['2']['firstname'] 
     62['Adrian'] 
    3463"""