Changeset 6649
- Timestamp:
- 29 Aug 2011, 08:07:36 (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/browser.py
r6647 r6649 232 232 student.student_id = student_id 233 233 self.applyData(student, **data) 234 #import pdb; pdb.set_trace()235 234 try: 236 235 self.context.addStudent(student) … … 337 336 grok.context(IStudent) 338 337 grok.name('edit_clearance') 339 grok.require('waeup. viewStudents')338 grok.require('waeup.manageStudents') 340 339 form_fields = grok.AutoFields(IStudentClearance) 341 340 label = 'Edit clearance data' … … 391 390 return '%s: Study Course' % self.context.__parent__.name 392 391 392 class StudyCourseManageActionButton(ManageActionButton): 393 grok.order(1) 394 grok.context(IStudentStudyCourse) 395 grok.view(StudyCourseDisplayFormPage) 396 grok.require('waeup.manageStudents') 397 text = 'Edit' 398 target = 'edit' 399 400 class StudyCourseManageFormPage(WAeUPEditFormPage): 401 """ Page to edit the student study course data 402 """ 403 grok.context(IStudentStudyCourse) 404 grok.name('edit') 405 grok.require('waeup.manageStudents') 406 form_fields = grok.AutoFields(IStudentStudyCourse) 407 label = 'Edit clearance data' 408 title = 'Study Course' 409 label = 'Edit study course' 410 pnav = 4 411 393 412 class PaymentsDisplayFormPage(WAeUPDisplayFormPage): 394 413 """ Page to display the student payments -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6647 r6649 150 150 self.browser.getControl("Create student record").click() 151 151 self.assertTrue('Student record created' in self.browser.contents) 152 self.browser.open(self.manage_container_path) 153 self.browser.getLink("Add student").click() 154 self.browser.getControl(name="form.student_id").value = 'A123456' 155 self.browser.getControl(name="form.name").value = 'Bob Brother' 156 self.browser.getControl("Create student record").click() 157 self.assertTrue('The student id chosen already exists' in self.browser.contents) 152 158 153 159 self.browser.open(self.container_path) … … 200 206 self.assertEqual(self.browser.headers['Status'], '200 Ok') 201 207 self.assertEqual(self.browser.url, self.manage_student_path) 202 # Managers can fire transitions208 # Managers can edit base data and fire transitions 203 209 self.browser.getControl(name="transition").value = ['admit'] 210 self.browser.getControl(name="form.name").value = 'John Tester' 204 211 self.browser.getControl("Save").click() 205 212 self.assertTrue('Form has been saved' in self.browser.contents) … … 225 232 self.assertEqual(self.browser.headers['Status'], '200 Ok') 226 233 self.assertEqual(self.browser.url, self.studycourse_student_path) 234 self.browser.getLink("Edit").click() 235 self.assertTrue('Edit study course' in self.browser.contents) 227 236 228 237 self.browser.open(self.student_path)
Note: See TracChangeset for help on using the changeset viewer.