summaryrefslogtreecommitdiff
path: root/tests/migrations
diff options
context:
space:
mode:
authorDavid Wobrock <david.wobrock@gmail.com>2022-05-16 09:57:49 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-05-16 10:36:56 +0200
commit11310e9abbdd784aea4ba50451144fc9c239f71f (patch)
tree5034f1ec9eb9f1d44a58f1f1707424f9bbc3ba65 /tests/migrations
parent647480166bfe7532e8c471fef0146e3a17e6c0c9 (diff)
downloaddjango-11310e9abbdd784aea4ba50451144fc9c239f71f.tar.gz
Fixed #33710 -- Made RenameIndex operation a noop when the old and new name match.
Diffstat (limited to 'tests/migrations')
-rw-r--r--tests/migrations/test_operations.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
index cfd28b1b39..f3c4ea8ffe 100644
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -2988,6 +2988,11 @@ class OperationTests(OperationTestBase):
with connection.schema_editor() as editor, self.assertNumQueries(0):
operation.database_backwards(app_label, editor, new_state, project_state)
self.assertIndexNameExists(table_name, "new_pony_test_idx")
+ # Reapply, RenameIndex operation is a noop when the old and new name
+ # match.
+ with connection.schema_editor() as editor:
+ operation.database_forwards(app_label, editor, new_state, project_state)
+ self.assertIndexNameExists(table_name, "new_pony_test_idx")
# Deconstruction.
definition = operation.deconstruct()
self.assertEqual(definition[0], "RenameIndex")