summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2014-03-20 05:08:28 +0100
committerTim Graham <timograham@gmail.com>2014-03-24 13:24:52 -0400
commit1edfa155e34dde549ef0e93414f2846dce59e5f7 (patch)
tree3f07b7527e8bf057454afb9a49dbedbbc1195afe /tests
parentd81a9c50d84d515ddc8ee76ecc5ad5d86e210504 (diff)
Fixed #22293 -- Avoided renaming many-to-many tables to themselves.
Fixed this for both implementations of _alter_many_to_many, instead of in `alter_db_table` itself (more implementations).
Diffstat (limited to 'tests')
-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(