def delete_model(self, model):
        # Handle auto-created intermediary models
        for field in model._meta.local_many_to_many:
            if field.remote_field.through._meta.auto_created:
                self.delete_model(field.remote_field.through)

        # Delete the table
        self.execute(self.sql_delete_table % {
            "table": self.quote_name(model._meta.db_table),
        })
Test an import that should be valid.
dataset/ETHPy150Open django/django/django/db/backends/base/schema.py/BaseDatabaseSchemaEditor.delete_model--crossover with--dataset/ETHPy150Open duointeractive/media-nommer/media_nommer/utils/tests.py/ModImportingTests.test_valid_import