summaryrefslogtreecommitdiff
path: root/tests/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'tests/migrations')
-rw-r--r--tests/migrations/test_operations.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
index c83e333136..9d0eae7f01 100644
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -1080,12 +1080,12 @@ class OperationTests(OperationTestBase):
),
],
)
- new_state = project_state.clone()
- operation = migrations.RenameModel("Pony", "PinkPony")
- operation.state_forwards(app_label, new_state)
- with connection.schema_editor() as editor:
- operation.database_forwards(app_label, editor, project_state, new_state)
-
+ new_state = self.apply_operations(
+ app_label,
+ project_state,
+ operations=[migrations.RenameModel("Pony", "PinkPony")],
+ atomic=connection.features.supports_atomic_references_rename,
+ )
Pony = new_state.apps.get_model(app_label, "PinkPony")
Rider = new_state.apps.get_model(app_label, "Rider")
pony = Pony.objects.create()