Changeset 14949 for main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Timestamp:
- 9 Feb 2018, 09:17:58 (7 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py
r14934 r14949 160 160 self.prepare_applicant() 161 161 self.browser.open(self.container_path + '/createallstudents') 162 self.assertTrue('No student could be created' in self.browser.contents)162 self.assertTrue('No record found' in self.browser.contents) 163 163 IWorkflowState(self.applicant).setState('admitted') 164 164 notify(grok.ObjectModifiedEvent(self.applicant)) 165 165 self.browser.open(self.container_path + '/createallstudents') 166 self.assertTrue('No student could be created' in self.browser.contents)166 self.assertTrue('No course admitted provided' in self.browser.contents) 167 167 logcontent = open(logfile).read() 168 168 self.assertTrue('No course admitted provided' in logcontent) … … 173 173 self.applicant.date_of_birth = None 174 174 self.browser.open(self.container_path + '/createallstudents') 175 self.assertTrue(' No student could be created' in self.browser.contents)175 self.assertTrue('RequiredMissing: date_of_birth' in self.browser.contents) 176 176 logcontent = open(logfile).read() 177 177 self.assertTrue('RequiredMissing: date_of_birth' in logcontent) … … 194 194 notify(grok.ObjectModifiedEvent(self.applicant)) 195 195 self.browser.open(self.root_path + '/createallstudents') 196 self.assertTrue('No student could be created' in self.browser.contents)196 self.assertTrue('No course admitted provided' in self.browser.contents) 197 197 logcontent = open(logfile).read() 198 198 self.assertTrue('No course admitted provided' in logcontent) … … 238 238 self.assertTrue('No student could be created.' in self.browser.contents) 239 239 self.browser.open(self.container_path + '/createallstudents') 240 self.assertTrue('No student could be created' in self.browser.contents) 241 logfile = os.path.join(self.app['datacenter'].storage, 'logs', 'applicants.log') 242 logcontent = open(logfile).read() 243 self.assertTrue('IOError: Application Slip could not be created.' in logcontent) 240 self.assertTrue( 241 'IOError: Application Slip could not be created.' 242 in self.browser.contents) 243 logfile = os.path.join( 244 self.app['datacenter'].storage, 'logs', 'applicants.log') 245 logcontent = open(logfile).read() 246 self.assertTrue( 247 'IOError: Application Slip could not be created.' in logcontent) 244 248 245 249 def disabled_test_delay(self): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r14366 r14949 536 536 self.assertEqual(self.applicantscontainer.counts[1], 0) 537 537 return 538 539 def init_officer(self): 540 # Create application officer 541 self.app['users'].addUser('mrappl', 'mrapplsecret') 542 self.app['users']['mrappl'].email = 'mrappl@foo.ng' 543 self.app['users']['mrappl'].title = 'Carlo Pitter' 544 prmglobal = IPrincipalRoleManager(self.app) 545 prmglobal.assignRoleToPrincipal('waeup.ApplicationsManager', 'mrappl') 546 # Login as officer 547 self.browser.open(self.login_path) 548 self.browser.getControl(name="form.login").value = 'mrappl' 549 self.browser.getControl(name="form.password").value = 'mrapplsecret' 550 self.browser.getControl("Login").click() 551 552 def test_student_creation_permission(self): 553 self.init_officer() 554 self.browser.open(self.container_path + '/manage') 555 self.browser.getControl("Create students").click() 556 self.assertTrue('You don\'t have permission to create student records' 557 in self.browser.contents) 558 prmglobal = IPrincipalRoleManager(self.app) 559 prmglobal.assignRoleToPrincipal('waeup.StudentsCreator', 'mrappl') 560 self.browser.getControl("Create students").click() 561 self.assertTrue('No applicant selected' in self.browser.contents) 562 538 563 539 564 class ApplicantUITests(ApplicantsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.