diff options
| author | django-bot <ops@djangoproject.com> | 2022-02-03 20:24:19 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-07 20:37:05 +0100 |
| commit | 9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch) | |
| tree | f0506b668a013d0063e5fba3dbf4863b466713ba /django/db/backends/sqlite3/features.py | |
| parent | f68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff) | |
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'django/db/backends/sqlite3/features.py')
| -rw-r--r-- | django/db/backends/sqlite3/features.py | 76 |
1 files changed, 41 insertions, 35 deletions
diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py index 153ce8d1d1..c076f0121e 100644 --- a/django/db/backends/sqlite3/features.py +++ b/django/db/backends/sqlite3/features.py @@ -43,49 +43,53 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_update_conflicts = Database.sqlite_version_info >= (3, 24, 0) supports_update_conflicts_with_target = supports_update_conflicts test_collations = { - 'ci': 'nocase', - 'cs': 'binary', - 'non_default': 'nocase', + "ci": "nocase", + "cs": "binary", + "non_default": "nocase", } django_test_expected_failures = { # The django_format_dtdelta() function doesn't properly handle mixed # Date/DateTime fields and timedeltas. - 'expressions.tests.FTimeDeltaTests.test_mixed_comparisons1', + "expressions.tests.FTimeDeltaTests.test_mixed_comparisons1", } @cached_property def django_test_skips(self): skips = { - 'SQLite stores values rounded to 15 significant digits.': { - 'model_fields.test_decimalfield.DecimalFieldTests.test_fetch_from_db_without_float_rounding', + "SQLite stores values rounded to 15 significant digits.": { + "model_fields.test_decimalfield.DecimalFieldTests.test_fetch_from_db_without_float_rounding", }, - 'SQLite naively remakes the table on field alteration.': { - 'schema.tests.SchemaTests.test_unique_no_unnecessary_fk_drops', - 'schema.tests.SchemaTests.test_unique_and_reverse_m2m', - 'schema.tests.SchemaTests.test_alter_field_default_doesnt_perform_queries', - 'schema.tests.SchemaTests.test_rename_column_renames_deferred_sql_references', + "SQLite naively remakes the table on field alteration.": { + "schema.tests.SchemaTests.test_unique_no_unnecessary_fk_drops", + "schema.tests.SchemaTests.test_unique_and_reverse_m2m", + "schema.tests.SchemaTests.test_alter_field_default_doesnt_perform_queries", + "schema.tests.SchemaTests.test_rename_column_renames_deferred_sql_references", }, "SQLite doesn't support negative precision for ROUND().": { - 'db_functions.math.test_round.RoundTests.test_null_with_negative_precision', - 'db_functions.math.test_round.RoundTests.test_decimal_with_negative_precision', - 'db_functions.math.test_round.RoundTests.test_float_with_negative_precision', - 'db_functions.math.test_round.RoundTests.test_integer_with_negative_precision', + "db_functions.math.test_round.RoundTests.test_null_with_negative_precision", + "db_functions.math.test_round.RoundTests.test_decimal_with_negative_precision", + "db_functions.math.test_round.RoundTests.test_float_with_negative_precision", + "db_functions.math.test_round.RoundTests.test_integer_with_negative_precision", }, } if Database.sqlite_version_info < (3, 27): - skips.update({ - 'Nondeterministic failure on SQLite < 3.27.': { - 'expressions_window.tests.WindowFunctionTests.test_subquery_row_range_rank', - }, - }) + skips.update( + { + "Nondeterministic failure on SQLite < 3.27.": { + "expressions_window.tests.WindowFunctionTests.test_subquery_row_range_rank", + }, + } + ) if self.connection.is_in_memory_db(): - skips.update({ - "the sqlite backend's close() method is a no-op when using an " - "in-memory database": { - 'servers.test_liveserverthread.LiveServerThreadTest.test_closes_connections', - 'servers.tests.LiveServerTestCloseConnectionTest.test_closes_connections', - }, - }) + skips.update( + { + "the sqlite backend's close() method is a no-op when using an " + "in-memory database": { + "servers.test_liveserverthread.LiveServerThreadTest.test_closes_connections", + "servers.tests.LiveServerTestCloseConnectionTest.test_closes_connections", + }, + } + ) return skips @cached_property @@ -94,12 +98,12 @@ class DatabaseFeatures(BaseDatabaseFeatures): @cached_property def introspected_field_types(self): - return{ + return { **super().introspected_field_types, - 'BigAutoField': 'AutoField', - 'DurationField': 'BigIntegerField', - 'GenericIPAddressField': 'CharField', - 'SmallAutoField': 'AutoField', + "BigAutoField": "AutoField", + "DurationField": "BigIntegerField", + "GenericIPAddressField": "CharField", + "SmallAutoField": "AutoField", } @cached_property @@ -112,11 +116,13 @@ class DatabaseFeatures(BaseDatabaseFeatures): return False return True - can_introspect_json_field = property(operator.attrgetter('supports_json_field')) - has_json_object_function = property(operator.attrgetter('supports_json_field')) + can_introspect_json_field = property(operator.attrgetter("supports_json_field")) + has_json_object_function = property(operator.attrgetter("supports_json_field")) @cached_property def can_return_columns_from_insert(self): return Database.sqlite_version_info >= (3, 35) - can_return_rows_from_bulk_insert = property(operator.attrgetter('can_return_columns_from_insert')) + can_return_rows_from_bulk_insert = property( + operator.attrgetter("can_return_columns_from_insert") + ) |
