From 7d8687ea35bb588fabf7f756c70e86bc78831108 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Thu, 8 Mar 2007 09:28:45 +0000 Subject: [PATCH] Fixed #3616 -- Added some more data structure tests from Chris McAvoy. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4684 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/datastructures/tests.py | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py index 624e7a50bf..90fb2d56a2 100644 --- a/tests/regressiontests/datastructures/tests.py +++ b/tests/regressiontests/datastructures/tests.py @@ -31,4 +31,33 @@ 'nonexistent' >>> d.setlist('lastname', ['Holovaty', 'Willison']) -""" \ No newline at end of file +### SortedDict ################################################################# + +>>> d = SortedDict() +>>> d['one'] = 'one' +>>> d['two'] = 'two' +>>> d['three'] = 'three' +>>> d['one'] +'one' +>>> d['two'] +'two' +>>> d['three'] +'three' +>>> d.keys() +['one', 'two', 'three'] +>>> d.values() +['one', 'two', 'three'] +>>> d['one'] = 'not one' +>>> d['one'] +'not one' + +### DotExpandedDict ############################################################ + +>>> d = DotExpandedDict({'person.1.firstname': ['Simon'], 'person.1.lastname': ['Willison'], 'person.2.firstname': ['Adrian'], 'person.2.lastname': ['Holovaty']}) +>>> d['person']['1']['lastname'] +['Willison'] +>>> d['person']['2']['lastname'] +['Holovaty'] +>>> d['person']['2']['firstname'] +['Adrian'] +"""