def METHOD_NAME(widget, value, expected):
    """The value of the input can be set."""
    # Clear the event log
    EventLog.reset()
    # Install an on_change handler
    handler = Mock()
    widget.on_change = handler
    widget.value = value
    assert widget.value == expected
    # test backend has the right value
    assert attribute_value(widget, "value") == expected
    # A refresh was performed
    assert_action_performed(widget, "refresh")
    # Callback was invoked
    handler.assert_called_once_with(widget)