1
0
mirror of https://github.com/django/django.git synced 2025-06-05 03:29:12 +00:00

[4.1.x] Refs #33953 -- Fixed test_rename_model_with_db_table_rename_m2m() crash on SQLite < 3.20.

Backport of a9e7beb959bc726eab1c192d2625d6ff6cfa70f4 from main
This commit is contained in:
Mariusz Felisiak 2022-08-29 10:07:53 +02:00
parent e98869a8a8
commit 524ea6b77b

View File

@ -1074,12 +1074,12 @@ class OperationTests(OperationTestBase):
), ),
], ],
) )
new_state = project_state.clone() new_state = self.apply_operations(
operation = migrations.RenameModel("Pony", "PinkPony") app_label,
operation.state_forwards(app_label, new_state) project_state,
with connection.schema_editor() as editor: operations=[migrations.RenameModel("Pony", "PinkPony")],
operation.database_forwards(app_label, editor, project_state, new_state) atomic=connection.features.supports_atomic_references_rename,
)
Pony = new_state.apps.get_model(app_label, "PinkPony") Pony = new_state.apps.get_model(app_label, "PinkPony")
Rider = new_state.apps.get_model(app_label, "Rider") Rider = new_state.apps.get_model(app_label, "Rider")
pony = Pony.objects.create() pony = Pony.objects.create()