def get_class_name_with_new_suffix(klass, existing_suffix, new_suffix):
    """
    Generates new name by replacing the existing suffix with a new one.

    Args:
        klass (type): original class from which new name is generated
        existing_suffix (str): the suffix which needs to remain where it is
        new_suffix (str): the new suffix desired

    Example:
        >>> get_class_name_with_new_suffix(FooForm, 'Form', 'NewForm')
        'FooNewForm'

    Returns:
        new_name (str): the name with the new suffix
    """
    class_name = klass.__name__

    if existing_suffix in class_name:
        prefix, suffix = class_name.rsplit(existing_suffix, 1)
    else:
        prefix, suffix = class_name, ''

    new_name = str('{}{}{}'.format(prefix, new_suffix, suffix))

    return new_name