mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
review fixes
This commit is contained in:
parent
7bb9cc421c
commit
6af2b54192
@ -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")
|
||||||
|
@ -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",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user