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

[5.0.x] Applied Black's 2024 stable style.

https://github.com/psf/black/releases/tag/24.1.0

Backport of 305757aec1 from main
This commit is contained in:
Mariusz Felisiak
2024-01-26 12:45:07 +01:00
parent 86dd89e623
commit 0379e7532f
234 changed files with 804 additions and 599 deletions

View File

@@ -646,9 +646,10 @@ class SchemaTests(TransactionTestCase):
# Add the new field
new_field = IntegerField(null=True)
new_field.set_attributes_from_name("age")
with CaptureQueriesContext(
connection
) as ctx, connection.schema_editor() as editor:
with (
CaptureQueriesContext(connection) as ctx,
connection.schema_editor() as editor,
):
editor.add_field(Author, new_field)
drop_default_sql = editor.sql_alter_column_no_default % {
"column": editor.quote_name(new_field.name),
@@ -2486,9 +2487,10 @@ class SchemaTests(TransactionTestCase):
with self.assertRaises(DatabaseError):
self.column_classes(new_field.remote_field.through)
# Add the field
with CaptureQueriesContext(
connection
) as ctx, connection.schema_editor() as editor:
with (
CaptureQueriesContext(connection) as ctx,
connection.schema_editor() as editor,
):
editor.add_field(LocalAuthorWithM2M, new_field)
# Table is not rebuilt.
self.assertEqual(
@@ -2966,9 +2968,11 @@ class SchemaTests(TransactionTestCase):
)
# Redundant foreign key index is not added.
self.assertEqual(
len(old_constraints) - 1
if connection.features.supports_partial_indexes
else len(old_constraints),
(
len(old_constraints) - 1
if connection.features.supports_partial_indexes
else len(old_constraints)
),
len(new_constraints),
)