diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-01-03 06:56:10 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-01-03 06:56:10 +0000 |
| commit | e8b001f46f7d5dff9268cf5a800a35bb505112bf (patch) | |
| tree | e5ef8cdecfeb2cf0f3dd4149702e8d23c9d9865d /tests/regressiontests/datastructures | |
| parent | 618e1b1587c8447b26df0c66a53b80ca1c67aa9e (diff) | |
[1.1.X] Fixed #12476 -- Forced the rollout of generators passed to SortedDict so that the data source can be read twice. Thanks to gsf for the report, and Alex for the patch.
Backport of r12064 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12065 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/datastructures')
| -rw-r--r-- | tests/regressiontests/datastructures/tests.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py index e658f3302e..b7885e65a4 100644 --- a/tests/regressiontests/datastructures/tests.py +++ b/tests/regressiontests/datastructures/tests.py @@ -60,9 +60,9 @@ MultiValueDictKeyError: "Key 'lastname' not found in <MultiValueDict: {'position >>> d.setlist('lastname', ['Holovaty', 'Willison']) >>> d.getlist('lastname') ['Holovaty', 'Willison'] ->>> d.values() +>>> d.values() ['Developer', 'Simon', 'Willison'] ->>> list(d.itervalues()) +>>> list(d.itervalues()) ['Developer', 'Simon', 'Willison'] ### SortedDict ################################################################# @@ -95,6 +95,9 @@ True >>> d.pop('one', 'missing') 'missing' +>>> SortedDict((i, i) for i in xrange(3)) +{0: 0, 1: 1, 2: 2} + We don't know which item will be popped in popitem(), so we'll just check that the number of keys has decreased. >>> l = len(d) |
