'makemigrations should raise InconsistentMigrationHistory exception if
there are some migrations applied before their dependencies.'

def test_makemigrations_inconsistent_history(self):

    recorder = MigrationRecorder(connection)
    recorder.record_applied('migrations', '0002_second')
    msg = 'Migration    migrations.0002_second    is    applied    before    its    dependency    migrations.0001_initial'
    with self.temporary_migration_module(module='migrations.test_migrations'):
        with self.assertRaisesMessage(InconsistentMigrationHistory, msg):
            call_command('makemigrations')
