Ignore:
Timestamp:
11 Feb 2014, 07:49:25 (11 years ago)
Author:
Henrik Bettermann
Message:

Do not show public user name in history when activating or deactivating students.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r10902 r11069  
    711711            self.browser.contents)
    712712        self.student.suspended = False
     713
     714    def test_activate_deactivate_buttons(self):
     715        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     716        self.browser.open(self.student_path)
     717        self.browser.getLink("Deactivate").click()
     718        self.assertTrue(
     719            'Student account has been deactivated.' in self.browser.contents)
     720        self.assertTrue(
     721            'Base Data (account deactivated)' in self.browser.contents)
     722        self.assertTrue(self.student.suspended)
     723        self.browser.getLink("Activate").click()
     724        self.assertTrue(
     725            'Student account has been activated.' in self.browser.contents)
     726        self.assertFalse(
     727            'Base Data (account deactivated)' in self.browser.contents)
     728        self.assertFalse(self.student.suspended)
     729        # History messages have been added ...
     730        self.browser.getLink("History").click()
     731        # User is undisclosed
     732        self.assertTrue(
     733            'Student account deactivated<br />' in self.browser.contents)
     734        self.assertTrue(
     735            'Student account activated<br />' in self.browser.contents)
     736        # ... and actions have been logged.
     737        logfile = os.path.join(
     738            self.app['datacenter'].storage, 'logs', 'students.log')
     739        logcontent = open(logfile).read()
     740        self.assertTrue('zope.mgr - waeup.uniben.students.browser.CustomStudentDeactivatePage - '
     741                        'B1000000 - account deactivated' in logcontent)
     742        self.assertTrue('zope.mgr - waeup.uniben.students.browser.CustomStudentActivatePage - '
     743                        'B1000000 - account activated' in logcontent)
Note: See TracChangeset for help on using the changeset viewer.