1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +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)
if connection.features.requires_fk_constraints_to_be_recreated:
self.assertIs(
self.assertTrue(
any(
"DROP FOREIGN KEY" in query["sql"] for query in ctx.captured_queries
),
True,
)
)
self.assertIs(
any("ADD CONSTRAINT" in query["sql"] for query in ctx.captured_queries),
True,
self.assertTrue(
any("ADD CONSTRAINT" in query["sql"] for query in ctx.captured_queries)
)
else:
self.assertIs(
any(
"DROP CONSTRAINT" in query["sql"] for query in ctx.captured_queries
),
False,
self.assertTrue(
any("DROP CONSTRAINT" in query["sql"] for query in ctx.captured_queries)
)
@skipUnlessDBFeature("supports_foreign_keys", "can_introspect_foreign_keys")

View File

@ -14,10 +14,20 @@
DATABASES = {
"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": {
"ENGINE": "django.db.backends.sqlite3",
"ENGINE": "django.db.backends.postgresql",
"NAME": "django",
"USER": "postgres",
"PASSWORD": "postgres",
"HOST": "127.0.0.1",
"PORT": "5432",
},
}