Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[py3] Fixed invalid use of dict.items()

An ordering test had two problems related to dict.items() usage:
  - It assumed the order of the dict was non-randomized
  - It indexed to the dict.items() which is py3 incompatible.

I fixed the test by using dict['rank'] directly, where rank is the
column tested on the values queryset.
  • Loading branch information...
commit 8fe03865f7d7059e051976d1f9336f2ff83a30c6 1 parent 9299dc4
@akaariai akaariai authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 tests/regressiontests/queries/tests.py
View
4 tests/regressiontests/queries/tests.py
@@ -1272,8 +1272,8 @@ def test_ordering(self):
# them in a values() query.
dicts = qs.values('id', 'rank').order_by('id')
self.assertEqual(
- [d.items()[1] for d in dicts],
- [('rank', 2), ('rank', 1), ('rank', 3)]
+ [d['rank'] for d in dicts],
+ [2, 1, 3]
)
def test_ticket7256(self):
Please sign in to comment.
Something went wrong with that request. Please try again.