'Makes sure the loader can load migrations with a dependency on an unmigrated app.'

@override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations_unmigdep'})
def test_load_unmigrated_dependency(self):

    migration_loader = MigrationLoader(connection)
    self.assertEqual(migration_loader.graph.forwards_plan(('migrations', '0001_initial')), [('contenttypes', '0001_initial'), ('auth', '0001_initial'), ('migrations', '0001_initial')])
    project_state = migration_loader.project_state(('migrations', '0001_initial'))
    self.assertEqual(len([m for (a, m) in project_state.models if (a == 'migrations')]), 1)
    book_state = project_state.models[('migrations', 'book')]
    self.assertEqual([x for (x, y) in book_state.fields], ['id', 'user'])
