- Timestamp:
- 14 Jul 2021, 11:39:09 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r16545 r16551 1411 1411 return 1412 1412 1413 def test_create_student(self): 1414 # Managers can contact student 1415 IWorkflowState(self.applicant).setState('admitted') 1416 self.applicant.certificate = self.certificate 1417 self.applicant.course_admitted = self.certificate 1418 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1419 self.browser.open(self.manage_path) 1420 self.fill_correct_values() 1421 image = open(SAMPLE_IMAGE, 'rb') 1422 ctrl = self.browser.getControl(name='form.passport') 1423 file_ctrl = ctrl.mech_control 1424 file_ctrl.add_file(image, filename='myphoto.jpg') 1425 self.browser.getControl("Save").click() 1426 self.browser.open(self.view_path) 1427 self.browser.getLink("Create student").click() 1428 self.assertTrue('Student K1000000 created' in self.browser.contents) 1429 self.assertMatches( 1430 'Sending email from no-reply@waeup.org to xx@yy.zz:' 1431 '\nMessage:' 1432 '\nmsg: MIME-Version: 1.0' 1433 '\nmsg: Content-Type: text/plain; charset="us-ascii"' 1434 '\nmsg: Content-Transfer-Encoding: 7bit' 1435 '\nmsg: From: Administrator <no-reply@waeup.org>' 1436 '\nmsg: To: John Anthony Tester <xx@yy.zz>' 1437 '\nmsg: Reply-To: Administrator <contact@waeup.org>' 1438 '\nmsg: Subject: Your new Kofa student account' 1439 '\nmsg:' 1440 '\nmsg: Dear John Anthony Tester,' 1441 '\nmsg:' 1442 '\nmsg: Your student record of the Student Registration and Information Portal of' 1443 '\nmsg: Sample University has been created for you.' 1444 '\nmsg:' 1445 '\nmsg: Your user name: K1000000' 1446 '\nmsg: Your password: %s' 1447 '\nmsg: Login: http://localhost/app/login?login=K1000000&password=%s' 1448 '\nmsg:' 1449 '\nmsg: Or request a new secure password here: http://localhost/app/changepw' 1450 '\nmsg:' 1451 '\nmsg: Regards' 1452 '\nmsg:' % (self.applicant.application_number, self.applicant.application_number), 1453 self.get_fake_smtp_output() 1454 ) 1455 return 1413 1456 1414 1457 class ApplicantRegisterTests(ApplicantsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.