Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 7d8687ea35bb588fabf7f756c70e86bc78831108 1 parent 4823a53
Malcolm Tredinnick malcolmt authored
Showing with 30 additions and 1 deletion.
  1. +30 −1 tests/regressiontests/datastructures/tests.py
31 tests/regressiontests/datastructures/tests.py
View
@@ -31,4 +31,33 @@
'nonexistent'
>>> d.setlist('lastname', ['Holovaty', 'Willison'])
-"""
+### 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']
+"""
Please sign in to comment.
Something went wrong with that request. Please try again.