    ====================
    J01form control test
    ====================

    For more information about this test, see j01form.txt.

    This test will test the same as j01form.txt but including all controls.

    from __future__ import absolute_import
    from __future__ import print_function
      >>> from pprint import pprint
      >>> from p01.testbrowser.testing import getWSGITestBrowser
      >>> from p01.testbrowser.ftests.wsgitestapp import WSGITestApplication

    Setup the wsgi test application:

      >>> wsgi_app = WSGITestApplication()

    Let's setup the demo app and get a j01 form:

      >>> url = 'http://localhost/j01controls.html'
      >>> browser = getWSGITestBrowser(url, wsgi_app=wsgi_app)

    Check the page content:

      >>> print((browser.contents))

# Controls Tests

TextAreaControl
TextControl
HiddenControl
SelectControl
One Two
One Two
No Content
    TextAreaControl
    ---------------

      >>> control = browser.getControl(name='TextAreaControl')
      >>> control
>>> control.asDomString '
    '

      >>> control.value = u'textarea'

    FileControl
    -----------

    Check
    PasswordControl
    ---------------

    HiddenControl
    -------------

      >>> control = browser.getControl(name='HiddenControl')
      >>> control
>>> control.asDomString '
    '

      >>> control.value = u'hidden'

    TextControl
    -----------

      >>> control = browser.getControl(name='TextControl')
      >>> control
>>> control.asDomString '' >>> control.value = u'text' EMailControl ------------ DateControl ----------- DatetimeControl --------------- DatetimeLocalControl -------------------- TimeControl ----------- WeekControl ----------- MonthControl ------------ ColorControl ------------ SearchControl ------------- URLControl ---------- NumberControl ------------- TelControl ---------- SubmitControl ------------- ButtonControl ------------- ImageControl ------------ JSONRPCButtonControl -------------------- JSONRPCClickButtonControl ------------------------- JSONRPCContentButtonControl --------------------------- CloseButtonControl ------------------ ClickControlBase ---------------- JSONRPCClickControl ------------------- DialogButtonControl ------------------- DialogContentButtonControl -------------------------- ShowDialogButtonControl ----------------------- DialogCloseButtonControl ------------------------ DialogLinkControl ----------------- ItemControl ----------- CheckboxControl --------------- SelectControl ------------- RadioControl ------------ ListControl ----------- SelectControl ------------- >>> control = browser.getControl(name='SelectControl:list') >>> control >>> control.asDomString Traceback (most recent call last): ... NotImplementedError: Can't render ... as dom element string >>> for ctr in control.controls: ... print(ctr.asDomString) Uno Dos Tres
    Now set a value:

      >>> control.value = ['2']
      >>> control.value
      ['2']

    As you can see, the options get correctly dumped to string:

      >>> for ctr in control.controls:
      ...     print(ctr.asDomString)
Uno Dos Tres
    RadioControl
    ------------

      >>> control = browser.getControl(name='RadioControl:list')
      >>> control
>>> control.asDomString Traceback (most recent call last): ... NotImplementedError: Can't render ... as dom element string >>> for ctr in control.controls: ... print(ctr.asDomString)
    Now set a value:

      >>> control.value = ['2']
      >>> control.value
      ['2']

    As you can see, the options get correctly dumped to string:

      >>> for ctr in control.controls:
      ...     print(ctr.asDomString)
    CheckboxControl
    ---------------

      >>> control = browser.getControl(name='CheckboxControl:list')
      >>> control
>>> control.asDomString Traceback (most recent call last): ... NotImplementedError: Can't render ... as dom element string >>> for ctr in control.controls: ... print(ctr.asDomString)
    Now set a value:

      >>> control.value = ['2']
      >>> control.value
      ['2']

    As you can see, the options get correctly dumped to string:

      >>> for ctr in control.controls:
      ...     print(ctr.asDomString)
Now check if the dom get update by set the different control values: >>> print((browser.contents))

# Controls Tests

TextAreaControl
    textarea
TextControl
HiddenControl
SelectControl
One Two
One Two
No Content
TextArea --------- Make sure we don't get additional space in textarea elements. And also make sure that empty elements don't get rendered as single closing tags: >>> control = browser.getControl(name='TextAreaControl') >>> control.value 'textarea' >>> control.asDomString '
    textarea
    '

      >>> control.value = ''
      >>> control.asDomString
      '
' >>> print((browser.contents))

# Controls Tests

TextAreaControl
TextControl
HiddenControl
SelectControl
One Two
One Two
No Content