diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-25 04:00:15 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-25 04:00:15 +0000 |
| commit | 62b39322f30fc274de033441d652a0c6714f93d7 (patch) | |
| tree | 0450d85f91cdd022010d66d2a17d9aba67a2dd92 /tests | |
| parent | d62cfce213e9393407846477a1a599f847be8603 (diff) | |
Fixed #7496 -- It's now possible to pickle SortedDicts with pickle protocol 2
(used in caching). Thanks, John Huddleston.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/datastructures/tests.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py index f5d5b91d3d..9404a0a792 100644 --- a/tests/regressiontests/datastructures/tests.py +++ b/tests/regressiontests/datastructures/tests.py @@ -1,6 +1,7 @@ """ # Tests for stuff in django.utils.datastructures. +>>> import pickle >>> from django.utils.datastructures import * ### MergeDict ################################################################# @@ -103,13 +104,16 @@ Init from sequence of tuples >>> print repr(d) {1: 'one', 0: 'zero', 2: 'two'} +>>> pickle.loads(pickle.dumps(d, 2)) +{1: 'one', 0: 'zero', 2: 'two'} + >>> d.clear() >>> d {} >>> d.keyOrder [] -### DotExpandedDict ############################################################ +### DotExpandedDict ########################################################## >>> d = DotExpandedDict({'person.1.firstname': ['Simon'], 'person.1.lastname': ['Willison'], 'person.2.firstname': ['Adrian'], 'person.2.lastname': ['Holovaty']}) >>> d['person']['1']['lastname'] @@ -119,7 +123,7 @@ Init from sequence of tuples >>> d['person']['2']['firstname'] ['Adrian'] -### ImmutableList ################################################################ +### ImmutableList ############################################################ >>> d = ImmutableList(range(10)) >>> d.sort() Traceback (most recent call last): |
