diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-02-28 05:09:20 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-02-28 05:09:20 +0000 |
| commit | ff3423ca4cab29887f547189eaa1cf90a1988a6d (patch) | |
| tree | 5346aac7d51c79b06ed3125810078907156141fa /tests/regressiontests/datastructures | |
| parent | 5e34ce97df3563883f1c0035e2150f90fe78ed30 (diff) | |
newforms-admin: Merged to [4640]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4641 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/datastructures')
| -rw-r--r-- | tests/regressiontests/datastructures/__init__.py | 0 | ||||
| -rw-r--r-- | tests/regressiontests/datastructures/models.py | 0 | ||||
| -rw-r--r-- | tests/regressiontests/datastructures/tests.py | 34 |
3 files changed, 34 insertions, 0 deletions
diff --git a/tests/regressiontests/datastructures/__init__.py b/tests/regressiontests/datastructures/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/regressiontests/datastructures/__init__.py diff --git a/tests/regressiontests/datastructures/models.py b/tests/regressiontests/datastructures/models.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/regressiontests/datastructures/models.py diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py new file mode 100644 index 0000000000..624e7a50bf --- /dev/null +++ b/tests/regressiontests/datastructures/tests.py @@ -0,0 +1,34 @@ +""" +# Tests for stuff in django.utils.datastructures. + +>>> from django.utils.datastructures import * + +### MergeDict ################################################################# + +>>> d1 = {'chris':'cool','camri':'cute','cotton':'adorable','tulip':'snuggable', 'twoofme':'firstone'} +>>> d2 = {'chris2':'cool2','camri2':'cute2','cotton2':'adorable2','tulip2':'snuggable2'} +>>> d3 = {'chris3':'cool3','camri3':'cute3','cotton3':'adorable3','tulip3':'snuggable3'} +>>> d4 = {'twoofme':'secondone'} +>>> md = MergeDict( d1,d2,d3 ) +>>> md['chris'] +'cool' +>>> md['camri'] +'cute' +>>> md['twoofme'] +'firstone' +>>> md2 = md.copy() +>>> md2['chris'] +'cool' + +### MultiValueDict ########################################################## + +>>> d = MultiValueDict({'name': ['Adrian', 'Simon'], 'position': ['Developer']}) +>>> d['name'] +'Simon' +>>> d.getlist('name') +['Adrian', 'Simon'] +>>> d.get('lastname', 'nonexistent') +'nonexistent' +>>> d.setlist('lastname', ['Holovaty', 'Willison']) + +"""
\ No newline at end of file |
