mirror of
https://github.com/django/django.git
synced 2025-11-20 03:30:00 +00:00
Don't rely on dictionary ordering in tests
This commit is contained in:
parent
585aa11d23
commit
b9fc70141a
4 changed files with 35 additions and 25 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue