()
| 187 | |
| 188 | |
| 189 | def test_repr_nested_model() -> None: |
| 190 | class Child(BaseModel): |
| 191 | name: str |
| 192 | age: int |
| 193 | |
| 194 | class Parent(BaseModel): |
| 195 | name: str |
| 196 | child: Child |
| 197 | |
| 198 | model = Parent(name="Robert", child=Child(name="Foo", age=5)) |
| 199 | assert str(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))" |
| 200 | assert repr(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))" |
| 201 | |
| 202 | |
| 203 | def test_optional_list() -> None: |