Beispiel #1
0
def test_string_validate_not_acceptable_value():
    f = String()
    for fail_val in (10, None, list):
        with pytest.raises(FieldSet.Error) as e:
            f._validate_field(fail_val)
        assert 'Field "{}" is not a string'.format(f._name) in str(e)
Beispiel #2
0
def test_string_validate_not_acceptable_value():
    f = String()
    for fail_val in (10, None, list):
        with pytest.raises(FieldSet.Error) as e:
            f._validate_field(fail_val)
        assert 'Field "{}" is not a string'.format(f._name) in str(e)
Beispiel #3
0
def test_string_validate():
    f = String()
    assert f._validate_field('test') == 'test'
Beispiel #4
0
def test_string_validate():
    f = String()
    assert f._validate_field('test') == 'test'