1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Removed redundant list() calls.

This commit is contained in:
Tim Graham 2015-05-16 09:15:54 -04:00
parent c2bc1cefdc
commit eda12ceef1
3 changed files with 8 additions and 8 deletions

View File

@ -229,7 +229,7 @@ def deferred_class_factory(model, attrs):
# class won't be created (we get an exception). Therefore, we generate
# the name using the passed in attrs. It's OK to reuse an existing class
# object if the attrs are identical.
name = "%s_Deferred_%s" % (model.__name__, '_'.join(sorted(list(attrs))))
name = "%s_Deferred_%s" % (model.__name__, '_'.join(sorted(attrs)))
name = utils.truncate_name(name, 80, 32)
try:

View File

@ -140,13 +140,13 @@ class QueryDictTests(unittest.TestCase):
self.assertTrue(q.has_key('foo'))
self.assertIn('foo', q)
self.assertListEqual(sorted(list(six.iteritems(q))),
self.assertListEqual(sorted(six.iteritems(q)),
[('foo', 'another'), ('name', 'john')])
self.assertListEqual(sorted(list(six.iterlists(q))),
self.assertListEqual(sorted(six.iterlists(q)),
[('foo', ['bar', 'baz', 'another']), ('name', ['john'])])
self.assertListEqual(sorted(list(six.iterkeys(q))),
self.assertListEqual(sorted(six.iterkeys(q)),
['foo', 'name'])
self.assertListEqual(sorted(list(six.itervalues(q))),
self.assertListEqual(sorted(six.itervalues(q)),
['another', 'john'])
q.update({'foo': 'hello'})

View File

@ -32,12 +32,12 @@ class MultiValueDictTests(SimpleTestCase):
self.assertEqual(d.get('name'), 'Simon')
self.assertEqual(d.getlist('name'), ['Adrian', 'Simon'])
self.assertEqual(
sorted(list(six.iteritems(d))),
sorted(six.iteritems(d)),
[('name', 'Simon'), ('position', 'Developer')]
)
self.assertEqual(
sorted(list(six.iterlists(d))),
sorted(six.iterlists(d)),
[('name', ['Adrian', 'Simon']), ('position', ['Developer'])]
)
@ -52,7 +52,7 @@ class MultiValueDictTests(SimpleTestCase):
d.setlist('lastname', ['Holovaty', 'Willison'])
self.assertEqual(d.getlist('lastname'), ['Holovaty', 'Willison'])
self.assertEqual(sorted(list(six.itervalues(d))),
self.assertEqual(sorted(six.itervalues(d)),
['Developer', 'Simon', 'Willison'])
def test_appendlist(self):