mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed all E251 violations
This commit is contained in:
parent
c347f78cc1
commit
f67e18f39e
14 changed files with 37 additions and 37 deletions
|
@ -106,9 +106,9 @@ class SchemaTests(TransactionTestCase):
|
|||
# Make sure the FK constraint is present
|
||||
with self.assertRaises(IntegrityError):
|
||||
Book.objects.create(
|
||||
author_id = 1,
|
||||
title = "Much Ado About Foreign Keys",
|
||||
pub_date = datetime.datetime.now(),
|
||||
author_id=1,
|
||||
title="Much Ado About Foreign Keys",
|
||||
pub_date=datetime.datetime.now(),
|
||||
)
|
||||
# Repoint the FK constraint
|
||||
new_field = ForeignKey(Tag)
|
||||
|
@ -211,7 +211,7 @@ class SchemaTests(TransactionTestCase):
|
|||
Author,
|
||||
Author._meta.get_field_by_name("name")[0],
|
||||
new_field,
|
||||
strict = True,
|
||||
strict=True,
|
||||
)
|
||||
# Ensure the field is right afterwards
|
||||
columns = self.column_classes(Author)
|
||||
|
@ -337,7 +337,7 @@ class SchemaTests(TransactionTestCase):
|
|||
Author,
|
||||
Author._meta.get_field_by_name("height")[0],
|
||||
new_field,
|
||||
strict = True,
|
||||
strict=True,
|
||||
)
|
||||
constraints = connection.introspection.get_constraints(connection.cursor(), Author._meta.db_table)
|
||||
for name, details in constraints.items():
|
||||
|
@ -349,7 +349,7 @@ class SchemaTests(TransactionTestCase):
|
|||
Author,
|
||||
new_field,
|
||||
Author._meta.get_field_by_name("height")[0],
|
||||
strict = True,
|
||||
strict=True,
|
||||
)
|
||||
constraints = connection.introspection.get_constraints(connection.cursor(), Author._meta.db_table)
|
||||
for name, details in constraints.items():
|
||||
|
@ -377,7 +377,7 @@ class SchemaTests(TransactionTestCase):
|
|||
Tag,
|
||||
Tag._meta.get_field_by_name("slug")[0],
|
||||
new_field,
|
||||
strict = True,
|
||||
strict=True,
|
||||
)
|
||||
# Ensure the field is no longer unique
|
||||
Tag.objects.create(title="foo", slug="foo")
|
||||
|
@ -391,7 +391,7 @@ class SchemaTests(TransactionTestCase):
|
|||
Tag,
|
||||
new_field,
|
||||
new_new_field,
|
||||
strict = True,
|
||||
strict=True,
|
||||
)
|
||||
# Ensure the field is unique again
|
||||
Tag.objects.create(title="foo", slug="foo")
|
||||
|
@ -405,7 +405,7 @@ class SchemaTests(TransactionTestCase):
|
|||
Tag,
|
||||
Tag._meta.get_field_by_name("slug")[0],
|
||||
TagUniqueRename._meta.get_field_by_name("slug2")[0],
|
||||
strict = True,
|
||||
strict=True,
|
||||
)
|
||||
# Ensure the field is still unique
|
||||
TagUniqueRename.objects.create(title="foo", slug2="foo")
|
||||
|
@ -572,7 +572,7 @@ class SchemaTests(TransactionTestCase):
|
|||
Book,
|
||||
Book._meta.get_field_by_name("title")[0],
|
||||
new_field,
|
||||
strict = True,
|
||||
strict=True,
|
||||
)
|
||||
# Ensure the table is there and has no index
|
||||
self.assertNotIn(
|
||||
|
@ -585,7 +585,7 @@ class SchemaTests(TransactionTestCase):
|
|||
Book,
|
||||
new_field,
|
||||
Book._meta.get_field_by_name("title")[0],
|
||||
strict = True,
|
||||
strict=True,
|
||||
)
|
||||
# Ensure the table is there and has the index again
|
||||
self.assertIn(
|
||||
|
@ -610,7 +610,7 @@ class SchemaTests(TransactionTestCase):
|
|||
BookWithSlug,
|
||||
BookWithSlug._meta.get_field_by_name("slug")[0],
|
||||
new_field2,
|
||||
strict = True,
|
||||
strict=True,
|
||||
)
|
||||
self.assertNotIn(
|
||||
"slug",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue