'Tests loading a squashed migration'

@override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations_squashed'})
def test_loading_squashed(self):

    migration_loader = MigrationLoader(connection)
    recorder = MigrationRecorder(connection)
    self.addCleanup(recorder.flush)
    self.assertEqual(len([x for x in migration_loader.graph.nodes if (x[0] == 'migrations')]), 1)
    recorder.record_applied('migrations', '0001_initial')
    migration_loader.build_graph()
    self.assertEqual(len([x for x in migration_loader.graph.nodes if (x[0] == 'migrations')]), 2)
