diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py index dfb8bd67bba..6dd4bea4e22 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