summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-07-18 14:08:47 +0200
committerGitHub <noreply@github.com>2023-07-18 14:08:47 +0200
commit3109038992321e471944bd8ee36670c9e6b8ff0c (patch)
tree634546c3ee6e252a66d332bb9756d14c5dcaf425 /tests
parent6ad2738a8f32b94cbae742f212080fadf2dee421 (diff)
Refs #33201 -- Avoided unnecessary queries when renaming models with db_table on SpatiaLite.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_operations.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
index e377e4ca64..a8fcb057ce 100644
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -988,6 +988,15 @@ class OperationTests(OperationTestBase):
"test_rmwsc_rider", ["pony_id"], ("test_rmwsc_littlehorse", "id")
)
+ def test_rename_model_no_relations_with_db_table_noop(self):
+ app_label = "test_rmwdbtnoop"
+ project_state = self.set_up_test_model(app_label, db_table="my_pony")
+ operation = migrations.RenameModel("Pony", "LittleHorse")
+ new_state = project_state.clone()
+ operation.state_forwards(app_label, new_state)
+ with connection.schema_editor() as editor, self.assertNumQueries(0):
+ operation.database_forwards(app_label, editor, project_state, new_state)
+
def test_rename_model_with_self_referential_m2m(self):
app_label = "test_rename_model_with_self_referential_m2m"