Event Views
-----------

Set up site, user and Event.

    >>> from zope.app.component.hooks import setSite
    >>> setSite(app.site)
    >>> uf = app.site.acl_users
    >>> uf._doAddUser('mgr', 'mgrpw', ['Manager'], [])
    >>> from AccessControl.SecurityManagement import newSecurityManager
    >>> newSecurityManager(None, uf.getUser('mgr').__of__(uf))
    >>> id = app.site.invokeFactory(type_name='Event', id='myEvent')

Create the browser object we'll be using.

    >>> from Products.Five.testbrowser import Browser
    >>> browser = Browser()
    >>> browser.handleErrors = False
    >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')

Use the edit form with invalid input.

    >>> browser.open('http://localhost/site/myEvent/@@edit.html')
    >>> browser.getControl('[[cmf_calendar][From]]').value = 'a'
    >>> browser.getControl('[[cmf_default][Change]]').click()
    >>> '[[zope][There were errors]]' in browser.contents
    True
    >>> '[[zope][Invalid datetime data]]' in browser.contents
    True

Use the edit form with valid input.

    >>> browser.getControl('[[cmf_calendar][From]]').value = '2006 11 6  12:00:00 '
    >>> browser.getControl('[[cmf_default][Change]]').click()
    >>> '[[zope][There were errors]]' in browser.contents
    False

Look at the result:

    >>> browser.open('http://localhost/site/myEvent/@@view.html')
    >>> '2006 11 6  12:00:00 ' in browser.contents
    True
