===================
Removal Subscribers
===================

To protect the data file, we need to make sure we remove InterventionStudent
and InterventionSchoolYear objects whenever their corresponding core objects
are removed.  For this we have subscriber adapters, PersonRemovedSubsciber and
SchoolYearRemovedSubsciber.  Although we can't functionally prove that these
subscribers are in fact called when we removed a person or schoolyear, we
can still create a functional script that will cause them to be called.
This way, at the very least, we can provide test coverage for them from
within the functional environment.

We'll set up a standard schoolyear and create a student.

    >>> from schooltool.app.browser.ftests import setup
    >>> setup.setUpBasicSchool()

    >>> from schooltool.intervention.browser.ftests import ftests
    >>> ftests.addPerson('Student1', 'Student1', 'student1', 'pwd')

We can do this test as the manager user.

    >>> manager = setup.logIn('manager', 'schooltool')

Now, when we search for the intervention student object for our student, it
will be auto-vivified.

    >>> manager.getLink('Intervention').click()
    >>> manager.getControl(name='SEARCH_STUDENT_BUTTON').click()

When we remove the student from the system, the PersonRemovedSubsciber will
be called (again, refer to functional test coverage).

    >>> manager.getLink('Manage').click()
    >>> manager.getLink('Persons').click()
    >>> manager.getControl(name='delete.student1').value = 'checked'
    >>> manager.getControl(name='DELETE').click()
    >>> manager.getControl(name='CONFIRM').click()

When we remove the student from the system, the SchoolYearRemovedSubsciber will
be called.

    >>> manager.getLink('Manage').click()
    >>> manager.getLink('School Years').click()
    >>> manager.getControl(name='delete.2005-2006').value = 'checked'
    >>> manager.getControl(name='DELETE').click()
    >>> manager.getControl(name='CONFIRM').click()

