()
| 161 | |
| 162 | |
| 163 | def test_unknown_fields() -> None: |
| 164 | m1 = BasicModel.construct(foo="foo", unknown=1) |
| 165 | assert m1.foo == "foo" |
| 166 | assert cast(Any, m1).unknown == 1 |
| 167 | |
| 168 | m2 = BasicModel.construct(foo="foo", unknown={"foo_bar": True}) |
| 169 | assert m2.foo == "foo" |
| 170 | assert cast(Any, m2).unknown == {"foo_bar": True} |
| 171 | |
| 172 | assert model_dump(m2) == {"foo": "foo", "unknown": {"foo_bar": True}} |
| 173 | |
| 174 | |
| 175 | def test_strict_validation_unknown_fields() -> None: |
nothing calls this directly
no test coverage detected