Don't rely on dictionary ordering in tests

This commit is contained in:
Ian Clelland 2012-09-28 00:27:38 -07:00 committed by Luke Plant
parent 585aa11d23
commit b9fc70141a
4 changed files with 35 additions and 25 deletions

View file

@ -130,15 +130,14 @@ class QueryDictTests(unittest.TestCase):
self.assertTrue(q.has_key('foo'))
self.assertTrue('foo' in q)
self.assertEqual(sorted(list(six.iteritems(q))),
[('foo', 'another'), ('name', 'john')])
self.assertEqual(sorted(list(six.iterlists(q))),
[('foo', ['bar', 'baz', 'another']), ('name', ['john'])])
self.assertEqual(sorted(list(six.iterkeys(q))),
['foo', 'name'])
self.assertEqual(sorted(list(six.itervalues(q))),
['another', 'john'])
self.assertEqual(len(q), 2)
self.assertListEqual(sorted(list(six.iteritems(q))),
[('foo', 'another'), ('name', 'john')])
self.assertListEqual(sorted(list(six.iterlists(q))),
[('foo', ['bar', 'baz', 'another']), ('name', ['john'])])
self.assertListEqual(sorted(list(six.iterkeys(q))),
['foo', 'name'])
self.assertListEqual(sorted(list(six.itervalues(q))),
['another', 'john'])
q.update({'foo': 'hello'})
self.assertEqual(q['foo'], 'hello')