'Makes sure the loader can load the migrations for the test apps,
and then render them out to a new Apps.'

@override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations'})
@modify_settings(INSTALLED_APPS={'append': 'basic'})
def test_load(self):

    migration_loader = MigrationLoader(connection)
    self.assertEqual(migration_loader.graph.forwards_plan(('migrations', '0002_second')), [('migrations', '0001_initial'), ('migrations', '0002_second')])
    project_state = migration_loader.project_state(('migrations', '0002_second'))
    self.assertEqual(len(project_state.models), 2)
    author_state = project_state.models[('migrations', 'author')]
    self.assertEqual([x for (x, y) in author_state.fields], ['id', 'name', 'slug', 'age', 'rating'])
    book_state = project_state.models[('migrations', 'book')]
    self.assertEqual([x for (x, y) in book_state.fields], ['id', 'author'])
    self.assertIn('basic', project_state.real_apps)
