コード例 #1
0
def test_validate_error_raises():
    with pytest.raises(ValidationError):
        raise ValidationError()

    error = ValidationErrorData(10, "string", "test1")
    msg = "test1 is <10> of type <{} 'int'> expected string".format(type_type)
    assert msg in str(error)
コード例 #2
0
def test_validate_error_none_field():
    error = ValidationErrorData(10, "string", None)
    msg = " is <10> of type <{} 'int'> expected string".format(type_type)
    assert msg in str(error)