()
| 202 | |
| 203 | |
| 204 | def test_repr_nested_model() -> None: |
| 205 | class Child(BaseModel): |
| 206 | name: str |
| 207 | age: int |
| 208 | |
| 209 | class Parent(BaseModel): |
| 210 | name: str |
| 211 | child: Child |
| 212 | |
| 213 | model = Parent(name="Robert", child=Child(name="Foo", age=5)) |
| 214 | assert str(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))" |
| 215 | assert repr(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))" |
| 216 | |
| 217 | |
| 218 | def test_optional_list() -> None: |