Ejemplo n.º 1
0
def test_validate_from_dict():
    instance = PersonModel.validate({
        "first_name": "Jean",
        "last_name": "Pierre"
    })
    assert isinstance(instance, PersonModel)
    assert instance.first_name == "Jean" and instance.last_name == "Pierre"
Ejemplo n.º 2
0
def test_validate_does_not_copy():
    instance = PersonModel(first_name="Jean", last_name="Pierre")
    assert PersonModel.validate(instance) is instance