Simple test for school years
============================

A manager logs in

    >>> from zope.testbrowser.testing import Browser
    >>> manager = Browser()
    >>> manager.addHeader('Authorization', 'Basic manager:schooltool')
    >>> manager.handleErrors = False
    >>> manager.open('http://localhost/')

Sets the time

    >>> manager.open('http://localhost/time')
    >>> manager.getControl('Today').value = "2005-02-15"
    >>> manager.getControl('Apply').click()

    >>> 'Data successfully updated.' in manager.contents
    True

And create a new school year:

    >>> manager.getLink('Manage').click()
    >>> manager.getLink('School Years').click()
    >>> manager.getLink('New School Year').click()
    >>> manager.getControl('Title').value = '2005-2006'
    >>> manager.getControl('First day').value = '2005-09-01'
    >>> manager.getControl('Last day').value = '2006-07-15'
    >>> manager.getControl('Add').click()

We should be redirected to the school year view now:

    >>> manager.url
    'http://localhost/schoolyears/2005-2006'

Let's add some terms:

    >>> manager.getLink('Add a new term').click()
    >>> manager.getControl('Title').value = 'Fall'
    >>> manager.getControl('Start date').value = '2005-09-01'
    >>> manager.getControl('End date').value = '2006-01-10'
    >>> manager.getControl('Next').click()
    >>> manager.getControl('Saturday').click()
    >>> manager.getControl('Sunday').click()
    >>> manager.getControl('Add term').click()

    >>> manager.getLink('Add a new term').click()
    >>> manager.getControl('Title').value = 'Spring'
    >>> manager.getControl('Start date').value = '2006-01-11'
    >>> manager.getControl('End date').value = '2006-07-15'
    >>> manager.getControl('Next').click()
    >>> manager.getControl('Saturday').click()
    >>> manager.getControl('Sunday').click()
    >>> manager.getControl('Add term').click()

TODO:
Test error messages being shown
