1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Refs #24424 -- Added regression tests for MTI-inheritance model removal.

The issue was fixed as a side effect of implementing RemoveField's reduction
of DeleteModel to a DeleteModel in ad82900ad9.
This commit is contained in:
Simon Charette
2018-07-25 12:07:42 -04:00
committed by Tim Graham
parent ac25dd1f8d
commit dc1dcad0f5
2 changed files with 33 additions and 0 deletions

View File

@@ -2354,3 +2354,13 @@ class AutodetectorTests(TestCase):
self.assertNumberMigrations(changes, 'testapp', 1)
self.assertOperationTypes(changes, 'testapp', 0, ["AddField", "AddField"])
self.assertOperationAttributes(changes, 'testapp', 0, 0)
def test_mti_inheritance_model_removal(self):
Animal = ModelState('app', 'Animal', [
("id", models.AutoField(primary_key=True)),
])
Dog = ModelState('app', 'Dog', [], bases=('app.Animal',))
changes = self.get_changes([Animal, Dog], [Animal])
self.assertNumberMigrations(changes, 'app', 1)
self.assertOperationTypes(changes, 'app', 0, ['DeleteModel'])
self.assertOperationAttributes(changes, 'app', 0, 0, name='Dog')