Changeset 9924 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 30 Jan 2013, 08:58:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9922 r9924 750 750 logcontent = open(logfile).read() 751 751 self.assertTrue('zope.mgr - students.browser.StudyLevelManageFormPage ' 752 '- K1000000 - removed: COURSE1 ' in logcontent)752 '- K1000000 - removed: COURSE1 at 100' in logcontent) 753 753 self.browser.getLink("here").click() 754 754 self.browser.getControl(name="form.course").value = ['COURSE1'] … … 1422 1422 cert,studylevel) 1423 1423 L110_student_path = self.studycourse_path + '/110' 1424 # Only in state courses registered and only if the current level 1425 # corresponds with the name of the study level object 1426 # the 100L CA does see the 'Validate' button 1424 # The CA can neither see the Validate nor the Edit button 1427 1425 self.browser.open(L110_student_path) 1428 1426 self.assertFalse('Validate courses' in self.browser.contents) 1427 self.assertFalse('Edit' in self.browser.contents) 1429 1428 IWorkflowInfo(self.student).fireTransition('register_courses') 1430 1429 self.browser.open(L110_student_path) 1431 1430 self.assertFalse('Validate courses' in self.browser.contents) 1431 self.assertFalse('Edit' in self.browser.contents) 1432 # Only in state courses registered and only if the current level 1433 # corresponds with the name of the study level object 1434 # the 100L CA does see the 'Validate' button but not 1435 # the edit button 1432 1436 self.student['studycourse'].current_level = 110 1433 1437 self.browser.open(L110_student_path) 1438 self.assertFalse('Edit' in self.browser.contents) 1434 1439 self.assertTrue('Validate courses' in self.browser.contents) 1435 # ... but a 100L CA does not see the button onother levels1440 # But a 100L CA does not see the button at other levels 1436 1441 studylevel2 = StudentStudyLevel() 1437 1442 studylevel2.level = 200 … … 1440 1445 L200_student_path = self.studycourse_path + '/200' 1441 1446 self.browser.open(L200_student_path) 1447 self.assertFalse('Edit' in self.browser.contents) 1442 1448 self.assertFalse('Validate courses' in self.browser.contents) 1443 1449 self.browser.open(L110_student_path) … … 1471 1477 self.browser.getControl("Send message now").click() 1472 1478 self.assertTrue('Your message has been sent' in self.browser.contents) 1479 # The CA does now see the Edit button and can edit 1480 # current study level 1481 self.browser.open(L110_student_path) 1482 self.browser.getLink("Edit").click() 1483 self.assertTrue('Edit course list of 100 (Year 1) on 1st probation' 1484 in self.browser.contents) 1473 1485 # The CA can't validate courses if not in state 1474 1486 # courses registered … … 2069 2081 self.browser.getControl("Register course list").click() 2070 2082 self.assertTrue('Maximum credits of 50 exceeded' in self.browser.contents) 2071 # Student can now remove the ticket ...2083 # Student can now remove the ticket 2072 2084 ctrl = self.browser.getControl(name='val_id') 2073 2085 ctrl.getControl(value='COURSE1').selected = True 2074 2086 self.browser.getControl("Remove selected", index=0).click() 2075 2087 self.assertTrue('Successfully removed' in self.browser.contents) 2076 # ... and add the same ticket using the edit page directly. 2088 # Removing course tickets is properly logged 2089 logfile = os.path.join( 2090 self.app['datacenter'].storage, 'logs', 'students.log') 2091 logcontent = open(logfile).read() 2092 self.assertTrue('K1000000 - students.browser.StudyLevelEditFormPage ' 2093 '- K1000000 - removed: COURSE1 at 200' in logcontent) 2094 # They can add the same ticket using the edit page directly. 2077 2095 # We can do the same by adding the course on the manage page directly 2078 2096 self.browser.getControl(name="course").value = 'COURSE1' 2079 2097 self.browser.getControl("Add course ticket").click() 2098 # Adding course tickets is logged 2099 logfile = os.path.join( 2100 self.app['datacenter'].storage, 'logs', 'students.log') 2101 logcontent = open(logfile).read() 2102 self.assertTrue('K1000000 - students.browser.StudyLevelEditFormPage - ' 2103 'K1000000 - added: COURSE1|200|2004' in logcontent) 2080 2104 # Course list can be registered 2081 2105 self.browser.getControl("Register course list").click()
Note: See TracChangeset for help on using the changeset viewer.