This file is indexed.

/usr/lib/python2.7/dist-packages/schooltool/intervention/browser/ftests/removal_subscribers.txt is in python-schooltool.intervention 2.7.1-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
===================
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()