summaryrefslogtreecommitdiff
path: root/tests/schema
diff options
context:
space:
mode:
Diffstat (limited to 'tests/schema')
-rw-r--r--tests/schema/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index 3eb826cee4..57c344ce8d 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -347,6 +347,15 @@ class SchemaTests(TransactionTestCase):
# Ensure there is now an m2m table there
columns = self.column_classes(new_field.rel.through)
self.assertEqual(columns['tagm2mtest_id'][0], "IntegerField")
+
+ # "Alter" the field. This should not rename the DB table to itself.
+ with connection.schema_editor() as editor:
+ editor.alter_field(
+ Author,
+ new_field,
+ new_field,
+ )
+
# Remove the M2M table again
with connection.schema_editor() as editor:
editor.remove_field(