How to use deform - 10 common examples

To help you get started, we’ve selected a few deform examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Pylons / pyramid_deform / pyramid_deform / tests.py View on Github external
def raiseit(*arg):
            exc = deform.exception.ValidationFailure(None, None, None)
            exc.render = lambda *arg: 'failure'
            raise exc
        inst.submit_success = raiseit
github Pylons / substanced / substanced / form / tests.py View on Github external
def raiseit(*arg):
            exc = deform.exception.ValidationFailure(None, None, None)
            exc.render = lambda *arg: 'failure'
            raise exc
        inst.submit_success = raiseit
github Pylons / substanced / substanced / form / tests.py View on Github external
def raiseit(*arg):
            raise deform.exception.ValidationFailure(None, None, None)
        inst.submit_success = raiseit
github liqd / adhocracy3 / src / adhocracy_core / adhocracy_core / schema / test_init.py View on Github external
def test_create_add_upload_widget_if_request(self, inst, request_):
        from deform.widget import FileUploadWidget
        inst = inst.bind(request=request_)
        assert isinstance(inst.widget, FileUploadWidget)
github liqd / adhocracy3 / src / adhocracy_core / adhocracy_core / schema / test_init.py View on Github external
def test_sequence_wiget_is_set(self):
        from deform.widget import SequenceWidget
        inst = self.make_one()
        assert isinstance(inst.widget,  SequenceWidget)
github ezeep / pyipptool / tests / test_widget.py View on Github external
def test_ipp_display_widget():
    from pyipptool.widgets import IPPDisplayWidget
    widget = IPPDisplayWidget()
    rendrer = DummyRenderer()
    field = DummyField(None, renderer=rendrer)
    response = widget.serialize(field, None)
    assert response == 'DISPLAY name'
github ezeep / pyipptool / tests / test_widget.py View on Github external
def test_ipp_name_widget():
    from pyipptool.widgets import IPPNameWidget
    widget = IPPNameWidget()
    rendrer = DummyRenderer()
    schema = DummySchema(name='FOO')

    field = DummyField(schema, renderer=rendrer)
    field.parent = None
    sub_field = DummyField(None, renderer=rendrer)
    sub_field.parent = field

    response = widget.serialize(sub_field, 'world')
    assert response == 'NAME "FOO"'
github ezeep / pyipptool / tests / test_widget.py View on Github external
def test_ipp_file_widget_with_None():
    from pyipptool.widgets import IPPFileWidget

    widget = IPPFileWidget()
    rendrer = DummyRenderer()

    field = DummyField(None, renderer=rendrer)
    with pytest.raises(ValueError):
        widget.serialize(field, None)
github ezeep / pyipptool / tests / test_widget.py View on Github external
def test_ipp_group_widget():
    from pyipptool.widgets import IPPGroupWidget
    widget = IPPGroupWidget()
    rendrer = DummyRenderer()
    schema = DummySchema(name='FOO')

    field = DummyField(schema, renderer=rendrer)
    field.parent = None
    sub_field = DummyField(None, renderer=rendrer)
    sub_field.parent = field

    response = widget.serialize(sub_field, 'world')
    assert response == 'GROUP FOO'
github ezeep / pyipptool / tests / test_widget.py View on Github external
def test_ipp_name_widget():
    from pyipptool.widgets import IPPNameWidget
    widget = IPPNameWidget()
    rendrer = DummyRenderer()
    schema = DummySchema(name='FOO')

    field = DummyField(schema, renderer=rendrer)
    field.parent = None
    sub_field = DummyField(None, renderer=rendrer)
    sub_field.parent = field

    response = widget.serialize(sub_field, 'world')
    assert response == 'NAME "FOO"'