class IgnoreEventRuleApplication(ExtModelApplication): """ IgnoreEventRule application """ title = _("Ignore Event Rules") menu = [_("Setup"), _("Ignore Event Rules")] model = IgnoreEventRules clean_fields = {"left_re": REParameter(), "right_re": REParameter()}
def test_re_parameter_error(raw, config): with pytest.raises(InterfaceTypeError): assert REParameter(**config).clean(raw)
def test_re_parameter(raw, config, expected): assert REParameter(**config).clean(raw) == expected
def test_re_parameter(): assert REParameter().clean(".+?") == ".+?" with pytest.raises(InterfaceTypeError): assert REParameter().clean("+")