Ignore:
Timestamp:
16 Apr 2021, 15:12:37 (4 years ago)
Author:
Henrik Bettermann
Message:

Enable managers to edit/remove all flash notices of students in a department.

File:
1 edited

Legend:

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

    r16459 r16465  
    18821882        return
    18831883
    1884     def test_remove_all_flash_notices(self):
     1884    #def test_remove_all_flash_notices(self):
     1885    #    self.student.flash_notice = u'test'
     1886    #    self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     1887    #    self.browser.open('http://localhost/app/faculties/fac1/dep1')
     1888    #    self.browser.getLink("Remove all flash notices").click()
     1889    #    self.assertTrue('1 flash notices have been removed' in self.browser.contents)
     1890    #    self.assertEqual(self.student.flash_notice, '')
     1891    #    return
     1892
     1893    def test_edit_all_flash_notices(self):
    18851894        self.student.flash_notice = u'test'
    18861895        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    18871896        self.browser.open('http://localhost/app/faculties/fac1/dep1')
    1888         self.browser.getLink("Remove all flash notices").click()
    1889         self.assertTrue('1 flash notices have been removed' in self.browser.contents)
    1890         self.assertEqual(self.student.flash_notice, '')
     1897        self.browser.getLink("Edit all flash notices").click()
     1898        self.browser.getControl(name="form.flash_notice").value = 'Hello'
     1899        self.browser.getControl("Save flash notices").click()
     1900        self.assertTrue('1 flash notices have been edited' in self.browser.contents)
     1901        self.assertEqual(self.student.flash_notice, 'Hello')
     1902        self.browser.getLink("Edit all flash notices").click()
     1903        self.browser.getControl("Save flash notices").click()
     1904        self.assertTrue('1 flash notices have been edited' in self.browser.contents)
     1905        self.assertEqual(self.student.flash_notice, None)
     1906        logfile = os.path.join(
     1907            self.app['datacenter'].storage, 'logs', 'main.log')
     1908        logcontent = open(logfile).read()
     1909        self.assertTrue(
     1910            'zope.mgr - students.browser.EditFlashNoticesFormPage - dep1 - '
     1911            'saved flash notice: Hello' in logcontent)
     1912        self.assertTrue(
     1913            'zope.mgr - students.browser.EditFlashNoticesFormPage - dep1 - '
     1914            'saved flash notice: None' in logcontent)
    18911915        return
    18921916
Note: See TracChangeset for help on using the changeset viewer.