- Timestamp:
- 19 Sep 2011, 10:54:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6782 r6798 115 115 116 116 # Populate university 117 certificate = createObject('waeup.Certificate')118 certificate.code = 'CERT1'119 certificate.application_category = 'basic'120 certificate.start_level = 100121 certificate.end_level = 500117 self.certificate = createObject('waeup.Certificate') 118 self.certificate.code = 'CERT1' 119 self.certificate.application_category = 'basic' 120 self.certificate.start_level = 100 121 self.certificate.end_level = 500 122 122 self.app['faculties']['fac1'] = Faculty() 123 123 self.app['faculties']['fac1']['dep1'] = Department() 124 124 self.app['faculties']['fac1']['dep1'].certificates.addCertificate( 125 certificate)125 self.certificate) 126 126 127 127 # Put the prepopulated site into test ZODB and prepare test … … 267 267 self.browser.contents) 268 268 269 # Managers can browse all subobjects 270 self.browser.open(self.student_path) 271 self.browser.getLink("Payments").click() 272 self.assertEqual(self.browser.headers['Status'], '200 Ok') 273 self.assertEqual(self.browser.url, self.payments_student_path) 274 self.browser.open(self.student_path) 275 self.browser.getLink("Accommodation").click() 276 self.assertEqual(self.browser.headers['Status'], '200 Ok') 277 self.assertEqual(self.browser.url, self.accommodation_student_path) 278 self.browser.open(self.student_path) 279 self.browser.getLink("History").click() 280 self.assertEqual(self.browser.headers['Status'], '200 Ok') 281 self.assertEqual(self.browser.url, self.history_student_path) 282 self.assertMatches('...Student admitted by zope.mgr...', 283 self.browser.contents) 284 285 def test_manage_course_lists(self): 286 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 269 287 self.browser.open(self.student_path) 270 288 self.browser.getLink("Study Course").click() … … 282 300 self.browser.getControl(name="form.current_level").value = ['100'] 283 301 self.browser.getControl("Save").click() 284 285 # Managers can add a any sudy level (course list) 302 # Managers can add a any study level (course list) 286 303 self.browser.getControl(name="addlevel").value = ['100'] 287 304 self.browser.getControl("Add study level").click() … … 289 306 self.browser.contents) 290 307 291 # Managers can browse all subobjects 292 self.browser.open(self.student_path) 293 self.browser.getLink("Payments").click() 294 self.assertEqual(self.browser.headers['Status'], '200 Ok') 295 self.assertEqual(self.browser.url, self.payments_student_path) 296 self.browser.open(self.student_path) 297 self.browser.getLink("Accommodation").click() 298 self.assertEqual(self.browser.headers['Status'], '200 Ok') 299 self.assertEqual(self.browser.url, self.accommodation_student_path) 300 self.browser.open(self.student_path) 301 self.browser.getLink("History").click() 302 self.assertEqual(self.browser.headers['Status'], '200 Ok') 303 self.assertEqual(self.browser.url, self.history_student_path) 304 self.assertMatches('...Student admitted by zope.mgr...', 305 self.browser.contents) 306 308 def test_manage_workflow(self): 307 309 # Managers can pass through the whole workflow 310 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 308 311 student = self.app['students'][self.test_student_id] 309 312 self.browser.open(self.manage_student_path) 310 313 self.assertTrue(student.clearance_locked) 314 self.browser.getControl(name="transition").value = ['admit'] 315 self.browser.getControl("Save").click() 316 self.assertTrue(student.clearance_locked) 311 317 self.browser.getControl(name="transition").value = ['start_clearance'] 312 318 self.browser.getControl("Save").click() … … 321 327 self.browser.getControl(name="transition").value = ['reset6'] 322 328 self.browser.getControl("Save").click() 323 # The pay_school_fee transition triggers some changes 329 # The pay_school_fee transition triggers some changes of previously 330 # set attributes 331 student['studycourse'].certificate = self.certificate 332 student['studycourse'].current_session = 2004 333 student['studycourse'].current_verdict = 'A' 334 student['studycourse'].current_level = 100 324 335 self.browser.getControl(name="transition").value = ['pay_school_fee'] 325 336 self.browser.getControl("Save").click() 326 self.assertEqual(student['studycourse'].current_session, 2005) # was 2004327 self.assertEqual(student['studycourse'].current_level, 200) # was 100328 self.assertEqual(student['studycourse'].current_verdict, '') # was 'A'329 self.assertEqual(student['studycourse'].previous_verdict, 'A') # was empty337 self.assertEqual(student['studycourse'].current_session, 2005) 338 self.assertEqual(student['studycourse'].current_level, 200) 339 self.assertEqual(student['studycourse'].current_verdict, '') 340 self.assertEqual(student['studycourse'].previous_verdict, 'A') 330 341 return 331 342
Note: See TracChangeset for help on using the changeset viewer.