diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-01-26 12:45:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-26 12:45:07 +0100 |
| commit | 305757aec19c9d5111e4d76095ae0acd66163e4b (patch) | |
| tree | 04aa017e66c06b3b19cb466ed4e1d73cd871523d /tests/schema | |
| parent | 3f6d939c62efd967f548c27a265748cc2cc47ca5 (diff) | |
Applied Black's 2024 stable style.
https://github.com/psf/black/releases/tag/24.1.0
Diffstat (limited to 'tests/schema')
| -rw-r--r-- | tests/schema/fields.py | 8 | ||||
| -rw-r--r-- | tests/schema/tests.py | 22 |
2 files changed, 18 insertions, 12 deletions
diff --git a/tests/schema/fields.py b/tests/schema/fields.py index 998cb28b8c..24a26b2c2c 100644 --- a/tests/schema/fields.py +++ b/tests/schema/fields.py @@ -41,9 +41,11 @@ class CustomManyToManyField(RelatedField): related_name=related_name, related_query_name=related_query_name, limit_choices_to=limit_choices_to, - symmetrical=symmetrical - if symmetrical is not None - else (to == RECURSIVE_RELATIONSHIP_CONSTANT), + symmetrical=( + symmetrical + if symmetrical is not None + else (to == RECURSIVE_RELATIONSHIP_CONSTANT) + ), through=through, through_fields=through_fields, db_constraint=db_constraint, diff --git a/tests/schema/tests.py b/tests/schema/tests.py index 61244f75b4..3a026281bd 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -640,9 +640,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), @@ -2483,9 +2484,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( @@ -2963,9 +2965,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), ) |
