mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +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:
committed by
Tim Graham
parent
ac25dd1f8d
commit
dc1dcad0f5
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user