summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliGhotbizadeh <ali.ghotbizadeh@gmail.com>2021-09-20 11:56:26 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-09-20 12:00:10 +0200
commitb8f3a3ad54b05b83774716483afac7d0b9535fb4 (patch)
treeefceda17e22f1d42e054aedfbd673f2b4a1fee09
parente441847ecae99dd1ccd0d9ce76dbcff51afa863c (diff)
downloaddjango-b8f3a3ad54b05b83774716483afac7d0b9535fb4.tar.gz
Refs #33119 -- Added tests for changing model name case referenced by ManyToManyField.
Fixed in aa4acc164d1247c0de515c959f7b09648b57dc42.
-rw-r--r--tests/migrations/test_autodetector.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py
index dfb8bd67bb..6dd4bea4e2 100644
--- a/tests/migrations/test_autodetector.py
+++ b/tests/migrations/test_autodetector.py
@@ -1074,6 +1074,19 @@ class AutodetectorTests(TestCase):
self.assertNumberMigrations(changes, 'testapp', 0)
self.assertNumberMigrations(changes, 'otherapp', 0)
+ def test_renamed_referenced_m2m_model_case(self):
+ publisher_renamed = ModelState('testapp', 'publisher', [
+ ('id', models.AutoField(primary_key=True)),
+ ('name', models.CharField(max_length=100)),
+ ])
+ changes = self.get_changes(
+ [self.publisher, self.author_with_m2m],
+ [publisher_renamed, self.author_with_m2m],
+ questioner=MigrationQuestioner({'ask_rename_model': True}),
+ )
+ self.assertNumberMigrations(changes, 'testapp', 0)
+ self.assertNumberMigrations(changes, 'otherapp', 0)
+
def test_rename_m2m_through_model(self):
"""
Tests autodetection of renamed models that are used in M2M relations as