Changeset 9484 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 31 Oct 2012, 16:01:42 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9452 r9484 1209 1209 self.browser.open(self.clearance_path) 1210 1210 self.browser.getLink("Reject clearance").click() 1211 self.assertEqual( 1212 self.browser.url, self.student_path + '/reject_clearance') 1213 # Type comment why 1214 self.browser.getControl(name="form.clearance_comment").value = """Dear Student, 1215 You did not fill properly. 1216 """ 1217 self.browser.getControl("Save comment").click() 1211 1218 self.assertTrue('Clearance has been annulled' in self.browser.contents) 1212 urlmessage = 'Clearance+has+been+annulled.' 1213 # CO does now see the contact form 1214 self.assertEqual(self.browser.url, self.student_path + 1215 '/contactstudent?subject=%s' % urlmessage) 1219 url = ('http://localhost/app/students/K1000000/' 1220 'contactstudent?body=Dear+Student%2C%0AYou+did+not+fill+properly.' 1221 '%0A&subject=Clearance+has+been+annulled.') 1222 # CO does now see the prefilled contact form and can send a message 1223 self.assertEqual(self.browser.url, url) 1216 1224 self.assertTrue('clearance started' in self.browser.contents) 1225 self.assertTrue('name="form.subject" size="20" type="text" ' 1226 'value="Clearance has been annulled."' 1227 in self.browser.contents) 1228 self.assertTrue('name="form.body" rows="10" >Dear Student,' 1229 in self.browser.contents) 1230 self.browser.getControl("Send message now").click() 1231 self.assertTrue('Your message has been sent' in self.browser.contents) 1232 # The comment has been stored ... 1233 self.assertEqual(self.student.clearance_comment, 1234 u'Dear Student,\nYou did not fill properly.\n') 1235 # ... and logged 1236 logfile = os.path.join( 1237 self.app['datacenter'].storage, 'logs', 'students.log') 1238 logcontent = open(logfile).read() 1239 self.assertTrue( 1240 'INFO - mrclear - students.browser.StudentRejectClearancePage - ' 1241 'K1000000 - comment: Dear Student,<br>You did not fill ' 1242 'properly.<br>\n' in logcontent) 1217 1243 self.browser.open(self.history_path) 1218 1244 self.assertTrue("Reset to 'clearance started' by My Public Name" in … … 1221 1247 self.browser.open(self.clearance_path) 1222 1248 self.browser.getLink("Reject clearance").click() 1249 self.browser.getControl("Save comment").click() 1223 1250 self.assertTrue('Clearance request has been rejected' 1224 1251 in self.browser.contents) 1225 1252 self.assertTrue('clearance started' in self.browser.contents) 1226 # CO does now also see the contact form and can send a message1227 self.browser.getControl(name="form.subject").value = 'Important subject'1228 self.browser.getControl(name="form.body").value = 'Clearance rejected'1229 self.browser.getControl("Send message now").click()1230 self.assertTrue('Your message has been sent' in self.browser.contents)1231 1253 # The CO can't clear students if not in state 1232 1254 # clearance requested … … 1240 1262 self.browser.getLink("Show students").click() 1241 1263 self.assertTrue(self.student_id in self.browser.contents) 1264 1265 1266 # When a student is cleared the comment is automatically deleted 1267 IWorkflowInfo(self.student).fireTransition('request_clearance') 1268 IWorkflowInfo(self.student).fireTransition('clear') 1269 self.assertEqual(self.student.clearance_comment, None) 1270 1242 1271 1243 1272 def test_handle_courses_by_ca(self): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r9427 r9484 43 43 result = open(self.outfile, 'rb').read() 44 44 self.assertTrue( 45 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 45 'adm_code,clearance_comment,clearance_locked,clr_code,' 46 'date_of_birth,email,employer,' 46 47 'firstname,lastname,matric_number,middlename,nationality,' 47 48 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 48 49 'state,history,certcode,is_postgrad,current_level,current_session\r\n' 49 50 50 'my adm code, 0,my clr code,1981-02-04#,anna@sample.com,,'51 'my adm code,,0,my clr code,1981-02-04#,anna@sample.com,,' 51 52 'Anna,Tester,234,M.,NG,"Studentroad 21\nLagos 123456\n",' 52 53 '+234-123-12345#,123,f,A111111,0,,created' … … 63 64 result = open(self.outfile, 'rb').read() 64 65 self.assertTrue( 65 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 66 'adm_code,clearance_comment,clearance_locked,clr_code,' 67 'date_of_birth,email,employer,' 66 68 'firstname,lastname,matric_number,middlename,nationality,' 67 69 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 68 70 'state,history,certcode,is_postgrad,current_level,current_session\r\n' 69 71 70 'my adm code, 0,my clr code,1981-02-04#,anna@sample.com,,'72 'my adm code,,0,my clr code,1981-02-04#,anna@sample.com,,' 71 73 'Anna,Tester,234,M.,NG,"Studentroad 21\nLagos 123456\n",' 72 74 '+234-123-12345#,123,f,A111111,0,,created' … … 82 84 result = open(self.outfile, 'rb').read() 83 85 self.assertTrue( 84 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 86 'adm_code,clearance_comment,clearance_locked,clr_code,' 87 'date_of_birth,email,employer,' 85 88 'firstname,lastname,matric_number,middlename,nationality,' 86 89 'perm_address,phone,reg_number,sex,student_id,suspended,password,' 87 90 'state,history,certcode,is_postgrad,current_level,current_session\r\n' 88 91 89 'my adm code, 0,my clr code,1981-02-04#,anna@sample.com,,'92 'my adm code,,0,my clr code,1981-02-04#,anna@sample.com,,' 90 93 'Anna,Tester,234,M.,NG,"Studentroad 21\nLagos 123456\n",' 91 94 '+234-123-12345#,123,f,A111111,0,,created'
Note: See TracChangeset for help on using the changeset viewer.