Changeset 6845 for main/waeup.sirp/trunk/src/waeup/sirp/students
- Timestamp:
- 2 Oct 2011, 08:15:51 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/container.py
r6838 r6845 45 45 'StudentsContainers contain only IStudent instances') 46 46 self[student.student_id] = student 47 # Return student_id (only needed in tests) 48 return student.student_id 47 return 49 48 50 49 logger_name = 'waeup.sirp.${sitename}.students' -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6818 r6845 74 74 student.reg_number = u'123' 75 75 student.matric_number = u'234' 76 self.test_student_id = self.app['students'].addStudent(student) 77 self.student = self.app['students'][self.test_student_id] 76 self.app['students'].addStudent(student) 77 self.student_id = student.student_id 78 self.student = self.app['students'][self.student_id] 78 79 79 80 # Set password 80 81 IUserAccount( 81 self.app['students'][self. test_student_id]).setPassword('spwd')82 self.app['students'][self.student_id]).setPassword('spwd') 82 83 83 84 self.login_path = 'http://localhost/app/login' … … 85 86 self.manage_container_path = self.container_path + '/@@manage' 86 87 self.add_student_path = self.container_path + '/addstudent' 87 self.student_path = self.container_path + '/' + self. test_student_id88 self.student_path = self.container_path + '/' + self.student_id 88 89 self.manage_student_path = self.student_path + '/edit_base' 89 90 self.clearance_student_path = self.student_path + '/view_clearance' … … 206 207 self.assertTrue('Empty search string' in self.browser.contents) 207 208 self.browser.getControl(name="searchtype").value = ['student_id'] 208 self.browser.getControl(name="searchterm").value = self. test_student_id209 self.browser.getControl(name="searchterm").value = self.student_id 209 210 self.browser.getControl("Search").click() 210 211 self.assertTrue('Anna Tester' in self.browser.contents) … … 222 223 223 224 ctrl = self.browser.getControl(name='entries') 224 ctrl.getControl(value=self. test_student_id).selected = True225 ctrl.getControl(value=self.student_id).selected = True 225 226 self.browser.getControl("Remove selected", index=0).click() 226 227 self.assertTrue('Successfully removed' in self.browser.contents) 227 228 self.browser.getControl(name="searchtype").value = ['student_id'] 228 self.browser.getControl(name="searchterm").value = self. test_student_id229 self.browser.getControl(name="searchterm").value = self.student_id 229 230 self.browser.getControl("Search").click() 230 231 self.assertTrue('No student found' in self.browser.contents) … … 232 233 self.browser.open(self.container_path) 233 234 self.browser.getControl(name="searchtype").value = ['student_id'] 234 self.browser.getControl(name="searchterm").value = self. test_student_id235 self.browser.getControl(name="searchterm").value = self.student_id 235 236 self.browser.getControl("Search").click() 236 237 self.assertTrue('No student found' in self.browser.contents) … … 354 355 # Managers can pass through the whole workflow 355 356 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 356 student = self.app['students'][self. test_student_id]357 student = self.app['students'][self.student_id] 357 358 self.browser.open(self.manage_student_path) 358 359 self.assertTrue(student.clearance_locked) … … 391 392 # Students can change the password 392 393 self.browser.open(self.login_path) 393 self.browser.getControl(name="form.login").value = self. test_student_id394 self.browser.getControl(name="form.login").value = self.student_id 394 395 self.browser.getControl(name="form.password").value = 'spwd' 395 396 self.browser.getControl("Login").click() … … 418 419 self.browser.getLink("Login").click() 419 420 self.browser.open(self.login_path) 420 self.browser.getControl(name="form.login").value = self. test_student_id421 self.browser.getControl(name="form.login").value = self.student_id 421 422 self.browser.getControl(name="form.password").value = 'new_password' 422 423 self.browser.getControl("Login").click() … … 430 431 student.reg_number = u'123456' 431 432 student.fullname = u'Klaus Tester' 432 test_student_id =self.app['students'].addStudent(student)433 self.app['students'].addStudent(student) 433 434 setpassword_path = 'http://localhost/app/setpassword' 434 student_path = 'http://localhost/app/students/%s' % test_student_id435 student_path = 'http://localhost/app/students/%s' % student.student_id 435 436 self.browser.open(setpassword_path) 436 437 self.browser.getControl(name="ac_series").value = self.existing_pwdseries … … 465 466 # The student can login with the new credentials 466 467 self.browser.open(self.login_path) 467 self.browser.getControl(name="form.login").value = test_student_id468 self.browser.getControl(name="form.login").value = student.student_id 468 469 self.browser.getControl( 469 470 name="form.password").value = self.existing_pwdnumber … … 476 477 # Students can access their own objects 477 478 # and can perform actions 478 student = self.app['students'][self. test_student_id]479 student = self.app['students'][self.student_id] 479 480 IWorkflowInfo(student).fireTransition('admit') 480 481 self.browser.open(self.login_path) 481 self.browser.getControl(name="form.login").value = self. test_student_id482 self.browser.getControl(name="form.login").value = self.student_id 482 483 self.browser.getControl(name="form.password").value = 'spwd' 483 484 self.browser.getControl("Login").click()
Note: See TracChangeset for help on using the changeset viewer.