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"
def test_validate_does_not_copy(): instance = PersonModel(first_name="Jean", last_name="Pierre") assert PersonModel.validate(instance) is instance