Beispiel #1
0
def test_field_get_settings_validator_raise_configration_error():
    f = Field()
    f.set_name('test')

    with pytest.raises(FieldSet.ConfigurationError) as e:
        f._get_setting_validator('my_setting')
    assert 'Setting "my_setting" is ' + \
           'not supported for field "test"' in str(e)
Beispiel #2
0
def test_field_get_settings_validator_raise_configration_error():
    f = Field()
    f.set_name('test')

    with pytest.raises(FieldSet.ConfigurationError) as e:
        f._get_setting_validator('my_setting')
    assert 'Setting "my_setting" is ' + \
           'not supported for field "test"' in str(e)
Beispiel #3
0
def test_field_get_settings_validator():
    f = Field()
    f._validate_my_setting = mock.Mock()
    assert f._get_setting_validator('my_setting') == f._validate_my_setting
Beispiel #4
0
def test_field_get_settings_validator():
    f = Field()
    f._validate_my_setting = mock.Mock()
    assert f._get_setting_validator('my_setting') == f._validate_my_setting