1
0
mirror of https://github.com/django/django.git synced 2025-06-05 11:39:13 +00:00

review fixes

This commit is contained in:
DevilsAutumn 2024-05-13 19:01:56 +05:30
parent 7bb9cc421c
commit 6af2b54192
2 changed files with 18 additions and 13 deletions

View File

@ -1768,22 +1768,17 @@ class SchemaTests(TransactionTestCase):
editor.alter_field(Book, old_field, new_field, strict=True) editor.alter_field(Book, old_field, new_field, strict=True)
if connection.features.requires_fk_constraints_to_be_recreated: if connection.features.requires_fk_constraints_to_be_recreated:
self.assertIs( self.assertTrue(
any( any(
"DROP FOREIGN KEY" in query["sql"] for query in ctx.captured_queries "DROP FOREIGN KEY" in query["sql"] for query in ctx.captured_queries
), )
True,
) )
self.assertIs( self.assertTrue(
any("ADD CONSTRAINT" in query["sql"] for query in ctx.captured_queries), any("ADD CONSTRAINT" in query["sql"] for query in ctx.captured_queries)
True,
) )
else: else:
self.assertIs( self.assertTrue(
any( any("DROP CONSTRAINT" in query["sql"] for query in ctx.captured_queries)
"DROP CONSTRAINT" in query["sql"] for query in ctx.captured_queries
),
False,
) )
@skipUnlessDBFeature("supports_foreign_keys", "can_introspect_foreign_keys") @skipUnlessDBFeature("supports_foreign_keys", "can_introspect_foreign_keys")

View File

@ -14,10 +14,20 @@
DATABASES = { DATABASES = {
"default": { "default": {
"ENGINE": "django.db.backends.sqlite3", "ENGINE": "django.db.backends.postgresql",
"NAME": "django",
"USER": "postgres",
"PASSWORD": "postgres",
"HOST": "127.0.0.1",
"PORT": "5432",
}, },
"other": { "other": {
"ENGINE": "django.db.backends.sqlite3", "ENGINE": "django.db.backends.postgresql",
"NAME": "django",
"USER": "postgres",
"PASSWORD": "postgres",
"HOST": "127.0.0.1",
"PORT": "5432",
}, },
} }