()
| 159 | |
| 160 | |
| 161 | def test_strict_validation_unknown_fields() -> None: |
| 162 | class Model(BaseModel): |
| 163 | foo: str |
| 164 | |
| 165 | model = parse_obj(Model, dict(foo="hello!", user="Robert")) |
| 166 | assert model.foo == "hello!" |
| 167 | assert cast(Any, model).user == "Robert" |
| 168 | |
| 169 | assert model_dump(model) == {"foo": "hello!", "user": "Robert"} |
| 170 | |
| 171 | |
| 172 | def test_aliases() -> None: |
nothing calls this directly
no test coverage detected