How to use the deform.tests.test_widget.DummyField function in deform

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 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"'
github ezeep / pyipptool / tests / test_widget.py View on Github external
def test_ipp_attribute_widget_with_None():
    from pyipptool.widgets import IPPAttributeWidget
    widget = IPPAttributeWidget()
    rendrer = DummyRenderer()
    schema = DummySchema()
    schema.typ = DummyType()
    field = DummyField(schema, renderer=rendrer)
    with pytest.raises(ValueError) as exc_info:
        widget.serialize(field, None)
    assert str(exc_info.value) == "None value provided for 'name'"
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_attribute_widget_with_value():
    from pyipptool.widgets import IPPAttributeWidget
    widget = IPPAttributeWidget()
    rendrer = DummyRenderer()
    schema = DummySchema()
    schema.typ = DummyType()
    field = DummyField(schema, renderer=rendrer)
    response = widget.serialize(field, 'hello')
    assert response == 'ATTR dummyType name hello'
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'