summaryrefslogtreecommitdiff
path: root/tests/schema
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-12-06 17:17:59 -0500
committerGitHub <noreply@github.com>2017-12-06 17:17:59 -0500
commita862af383969ade774f6b0fa1d331bc87b188b89 (patch)
tree57a264753921cb1ac689efeb9b78dd43fcdd1db0 /tests/schema
parent183fb7b2b9778f7d7cc91f5a7e5afec61b85179e (diff)
Fixed #28893 -- Removed unnecessary dict.items() calls.
Diffstat (limited to 'tests/schema')
-rw-r--r--tests/schema/tests.py10
1 files changed, 5 insertions, 5 deletions
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: