Plone Quick Upload Control Panel
================================

    >>> from plone.testing.z2 import Browser
    >>> from plone.app.testing import SITE_OWNER_NAME
    >>> from plone.app.testing import SITE_OWNER_PASSWORD
    >>> browser = Browser(layer['app'])
    >>> browser.handleErrors = False
    >>> portal = layer['portal']
    >>> portal_url = portal.absolute_url()

First, login:

    >>> browser.open(portal.absolute_url() + '/login_form')
    >>> browser.getControl(name='__ac_name').value = SITE_OWNER_NAME
    >>> browser.getControl(name='__ac_password').value = SITE_OWNER_PASSWORD
    >>> browser.getControl(name='submit').click()
    >>> 'You are now logged in' in browser.contents
    True

Get the quick upload property sheet which stores configuration data :

    >>> quickupload_properties = portal.portal_properties.quickupload_properties

Viewing the Quick Upload control panel
--------------------------------------

    >>> browser.open(portal_url + '/@@quickupload-controlpanel')
    >>> browser.url
    'http://nohost/plone/@@quickupload-controlpanel'

Click the cancel button:

    >>> browser.getControl(name="form.actions.cancel").click()
    >>> browser.url.endswith('plone_control_panel')
    True

There should be still no changes:

    >>> 'Changes canceled.' in browser.contents
    True

Make some changes
-----------------

    >>> browser.open(portal_url + '/@@quickupload-controlpanel')

    >>> browser.getControl('Automatic upload on select').selected = True
    >>> browser.getControl(name='form.size_limit').value = '200'


Click the save button:

    >>> browser.getControl("Save").click()
    >>> browser.url.endswith('quickupload-controlpanel')
    True

We should be informed that something has changed:

    >>> 'Changes saved.' in browser.contents
    True

Make sure the changes have been applied correctly to the quick upload properties sheet:

    >>> quickupload_properties.auto_upload
    True

    >>> quickupload_properties.size_limit
    200
