Changeset 9127 for main/waeup.kofa/trunk/src/waeup/kofa/utils/tests
- Timestamp:
- 30 Aug 2012, 08:55:31 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_browser.py
r9122 r9127 62 62 self.student.history.messages[0]) 63 63 64 def test_remove_student_history_message(self): 65 self.assertTrue('Record created by system' in 66 self.student.history.messages[0]) 67 self.assertEqual(len(self.student.history.messages),1) 68 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 69 self.browser.open('http://localhost/app/remove_student_history_message') 70 self.assertTrue( 71 'Syntax: /remove_student_history_message?student_id=[id]&number=[line number, starting with 0]' 72 in self.browser.contents) 73 self.browser.open( 74 'http://localhost/app/remove_student_history_message?student_id=%s&number=0' % self.student.student_id) 75 self.assertTrue('Finished' in self.browser.contents) 76 self.assertEqual(len(self.student.history.messages),0) 77 logfile = os.path.join( 78 self.app['datacenter'].storage, 'logs', 'main.log') 79 logcontent = open(logfile).read() 80 self.assertMatches( 81 "...zope.mgr - line '<YYYY-MM-DD hh:mm:ss> UTC - " 82 "Record created by system' removed in K1000000 history", 83 logcontent) 84 64 85 def test_reindex(self): 65 86 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 96 117 self.assertTrue('Application initialized by me' in 97 118 self.applicant.history.messages[0]) 119 120 def test_remove_applicant_history_message(self): 121 self.assertTrue('Application initialized by system' in 122 self.applicant.history.messages[0]) 123 self.assertEqual(len(self.applicant.history.messages),1) 124 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 125 self.browser.open('http://localhost/app/remove_applicant_history_message') 126 self.assertTrue( 127 'Syntax: /remove_applicant_history_message?applicant_id=[id]&number=[line number, starting with 0]' 128 in self.browser.contents) 129 self.browser.open( 130 'http://localhost/app/remove_applicant_history_message?applicant_id=%s&number=0' % self.applicant.applicant_id) 131 self.assertTrue('Finished' in self.browser.contents) 132 self.assertEqual(len(self.applicant.history.messages),0) 133 logfile = os.path.join( 134 self.app['datacenter'].storage, 'logs', 'main.log') 135 logcontent = open(logfile).read() 136 self.assertMatches( 137 "...zope.mgr - line '<YYYY-MM-DD hh:mm:ss> UTC - " 138 "Application initialized by system' removed in %s history" 139 % self.applicant.applicant_id, logcontent)
Note: See TracChangeset for help on using the changeset viewer.