mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #35487 -- Removed CASCADE from RemoveField() on PostgreSQL.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Adam Johnson <me@adamj.eu> Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
This commit is contained in:
committed by
Mariusz Felisiak
parent
de1117ea8e
commit
2a5aca38bb
@@ -2055,8 +2055,13 @@ class OperationTests(OperationTestBase):
|
||||
self.assertEqual(len(new_state.models["test_rmfl", "pony"].fields), 4)
|
||||
# Test the database alteration
|
||||
self.assertColumnExists("test_rmfl_pony", "pink")
|
||||
with connection.schema_editor() as editor:
|
||||
with (
|
||||
connection.schema_editor() as editor,
|
||||
CaptureQueriesContext(connection) as ctx,
|
||||
):
|
||||
operation.database_forwards("test_rmfl", editor, project_state, new_state)
|
||||
self.assertGreater(len(ctx.captured_queries), 0)
|
||||
self.assertNotIn("CASCADE", ctx.captured_queries[-1]["sql"])
|
||||
self.assertColumnNotExists("test_rmfl_pony", "pink")
|
||||
# And test reversal
|
||||
with connection.schema_editor() as editor:
|
||||
|
||||
Reference in New Issue
Block a user