'Tests prefix name matching'

@override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations'})
def test_name_match(self):

    migration_loader = MigrationLoader(connection)
    self.assertEqual(migration_loader.get_migration_by_prefix('migrations', '0001').name, '0001_initial')
    with self.assertRaises(AmbiguityError):
        migration_loader.get_migration_by_prefix('migrations', '0')
    with self.assertRaises(KeyError):
        migration_loader.get_migration_by_prefix('migrations', 'blarg')
