mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #28249 -- Removed unnecessary dict.keys() calls.
iter(dict) is equivalent to iter(dict.keys()).
This commit is contained in:
parent
2a5708a304
commit
21046e7773
43 changed files with 84 additions and 85 deletions
|
@ -136,7 +136,7 @@ class LookupTests(TestCase):
|
|||
Author.objects.bulk_create([Author() for i in range(test_range - Author.objects.count())])
|
||||
authors = {author.pk: author for author in Author.objects.all()}
|
||||
with self.assertNumQueries(expected_num_queries):
|
||||
self.assertEqual(Author.objects.in_bulk(authors.keys()), authors)
|
||||
self.assertEqual(Author.objects.in_bulk(authors), authors)
|
||||
|
||||
def test_values(self):
|
||||
# values() returns a list of dictionaries instead of object instances --
|
||||
|
@ -207,7 +207,7 @@ class LookupTests(TestCase):
|
|||
'id_plus_eight': 'id+8',
|
||||
}
|
||||
self.assertSequenceEqual(
|
||||
Article.objects.filter(id=self.a1.id).extra(select=data).values(*data.keys()),
|
||||
Article.objects.filter(id=self.a1.id).extra(select=data).values(*data),
|
||||
[{
|
||||
'id_plus_one': self.a1.id + 1,
|
||||
'id_plus_two': self.a1.id + 2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue