def test_frozen_preserved_on_model_field() -> None:
    """https://github.com/pydantic/pydantic/issues/2541"""

    @dataclasses.dataclass(frozen=True)
    class Infos:
        id: int

    @dataclasses.dataclass(frozen=True)
    class Item:
        name: str
        infos: Infos

    class Example(BaseModel):
        item: Item

    e = Example.model_validate({'item': {'name': '123', 'infos': {'id': '1'}}})
    assert e.item.name == '123'
    assert e.item.infos.id == 1
    with pytest.raises(dataclasses.FrozenInstanceError):
        e.item.infos.id = 2
https://github.com/pydantic/pydantic/issues/2541
tests/test_dataclasses.py