deprecated model fields should still be usable in historic migrations make sure no tables are created run migration make sure the right tables exist unmigrate everything make sure it s all gone deprecated model fields should still be usable in historic migrations make sure no tables are created run migration make sure the right tables exist unmigrate everything make sure it s all gone
from django.core.management import call_command
from django.test import override_settings

from .test_base import MigrationTestBase


class Tests(MigrationTestBase):
    

    @override_settings(
        MIGRATION_MODULES={"migrations": "migrations.deprecated_field_migrations"}
    )
    def test_migrate(self):
        
        self.assertTableNotExists("migrations_ipaddressfield")
        
        call_command("migrate", verbosity=0)
        
        self.assertTableExists("migrations_ipaddressfield")
        
        call_command("migrate", "migrations", "zero", verbosity=0)
        
        self.assertTableNotExists("migrations_ipaddressfield")