Changeset 16465 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 16 Apr 2021, 15:12:37 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r16459 r16465 1882 1882 return 1883 1883 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): 1885 1894 self.student.flash_notice = u'test' 1886 1895 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1887 1896 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) 1891 1915 return 1892 1916
Note: See TracChangeset for help on using the changeset viewer.