1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #28249 -- Removed unnecessary dict.keys() calls.

iter(dict) is equivalent to iter(dict.keys()).
This commit is contained in:
Jon Dufresne
2017-05-27 16:08:46 -07:00
committed by Tim Graham
parent 2a5708a304
commit 21046e7773
43 changed files with 84 additions and 85 deletions

View File

@@ -1463,7 +1463,7 @@ class ModelFormsetTest(TestCase):
# a formset for a Model that has a custom primary key that still needs to be
# added to the formset automatically
FormSet = modelformset_factory(ClassyMexicanRestaurant, fields=["tacos_are_yummy"])
self.assertEqual(sorted(FormSet().forms[0].fields.keys()), ['tacos_are_yummy', 'the_restaurant'])
self.assertEqual(sorted(FormSet().forms[0].fields), ['tacos_are_yummy', 'the_restaurant'])
def test_model_formset_with_initial_model_instance(self):
# has_changed should compare model instance and primary key