Fix Unicode corruption in sample YAML name generation (#570)

* fix(sample-generator): remove unnecessary unicode-escape decoding for name

* test(sample-generator): add test for creating model with unicode name
This commit is contained in:
Matías Zapata Contreras
2025-12-23 13:36:50 -03:00
committed by GitHub
parent 7aa105a3b5
commit 1d9deda101
2 changed files with 5 additions and 1 deletions

View File

@@ -70,7 +70,6 @@ def create_sample_rendercv_pydantic_model(
sample_content_dictionary = read_yaml(sample_content)["cv"]
cv = Cv(**sample_content_dictionary)
name = name.encode().decode("unicode-escape")
cv.name = name
design = built_in_design_adapter.validate_python({"theme": theme})

View File

@@ -37,6 +37,11 @@ class TestCreateSampleRendercvPydanticModel:
name="John Doe", theme="classic", locale="invalid"
)
def test_creates_model_with_unicode_name(self):
name = "Matías"
data_model = create_sample_rendercv_pydantic_model(name=name)
assert data_model.cv.name == name
class TestCreateSampleYamlInputFile:
@pytest.mark.parametrize(