From a862af383969ade774f6b0fa1d331bc87b188b89 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 6 Dec 2017 17:17:59 -0500 Subject: Fixed #28893 -- Removed unnecessary dict.items() calls. --- tests/schema/tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/schema') diff --git a/tests/schema/tests.py b/tests/schema/tests.py index 21ab60466f..7b6c99242d 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -180,7 +180,7 @@ class SchemaTests(TransactionTestCase): """ constraints = self.get_constraints(model._meta.db_table) constraint_fk = None - for name, details in constraints.items(): + for details in constraints.values(): if details['columns'] == [column] and details['foreign_key']: constraint_fk = details['foreign_key'] break @@ -836,7 +836,7 @@ class SchemaTests(TransactionTestCase): editor.create_model(LocalBook) # Ensure no FK constraint exists constraints = self.get_constraints(LocalBook._meta.db_table) - for name, details in constraints.items(): + for details in constraints.values(): if details['foreign_key']: self.fail('Found an unexpected FK constraint to %s' % details['columns']) old_field = LocalBook._meta.get_field("author") @@ -1430,7 +1430,7 @@ class SchemaTests(TransactionTestCase): editor.create_model(Author) # Ensure the constraint exists constraints = self.get_constraints(Author._meta.db_table) - for name, details in constraints.items(): + for details in constraints.values(): if details['columns'] == ["height"] and details['check']: break else: @@ -1442,7 +1442,7 @@ class SchemaTests(TransactionTestCase): with connection.schema_editor() as editor: editor.alter_field(Author, old_field, new_field, strict=True) constraints = self.get_constraints(Author._meta.db_table) - for name, details in constraints.items(): + for details in constraints.values(): if details['columns'] == ["height"] and details['check']: self.fail("Check constraint for height found") # Alter the column to re-add it @@ -1450,7 +1450,7 @@ class SchemaTests(TransactionTestCase): with connection.schema_editor() as editor: editor.alter_field(Author, new_field, new_field2, strict=True) constraints = self.get_constraints(Author._meta.db_table) - for name, details in constraints.items(): + for details in constraints.values(): if details['columns'] == ["height"] and details['check']: break else: -- cgit v1.3