def test_validate_slug_and_generate_if_needed_not_raises_errors( category, cleaned_input): validate_slug_and_generate_if_needed(category, "name", cleaned_input)
def test_validate_slug_and_generate_if_needed_generate_slug(cleaned_input): category = Category(name="test") validate_slug_and_generate_if_needed(category, "name", cleaned_input)
def test_validate_slug_and_generate_if_needed_raises_errors( category, cleaned_input): with pytest.raises(ValidationError): validate_slug_and_generate_if_needed(category, "name", cleaned_input)