def METHOD_NAME(cleaned_input):
    # given
    category = Category(name="test")
    previous_slug_value = cleaned_input["slug"]
    # when
    validate_slug_and_generate_if_needed(category, "name", cleaned_input)
    # then
    assert previous_slug_value != cleaned_input["slug"]
    assert cleaned_input["slug"] == cleaned_input["name"]