Ignore:
Timestamp:
30 Jan 2013, 08:58:37 (12 years ago)
Author:
Henrik Bettermann
Message:

Add new permission waeup.editStudyLevel to allow course advisers to edit study levels after rejection.

Improve logging. Creation and deletion of course tickets is now properly logged.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9922 r9924  
    750750        logcontent = open(logfile).read()
    751751        self.assertTrue('zope.mgr - students.browser.StudyLevelManageFormPage '
    752         '- K1000000 - removed: COURSE1' in logcontent)
     752        '- K1000000 - removed: COURSE1 at 100' in logcontent)
    753753        self.browser.getLink("here").click()
    754754        self.browser.getControl(name="form.course").value = ['COURSE1']
     
    14221422            cert,studylevel)
    14231423        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
    14271425        self.browser.open(L110_student_path)
    14281426        self.assertFalse('Validate courses' in self.browser.contents)
     1427        self.assertFalse('Edit' in self.browser.contents)
    14291428        IWorkflowInfo(self.student).fireTransition('register_courses')
    14301429        self.browser.open(L110_student_path)
    14311430        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
    14321436        self.student['studycourse'].current_level = 110
    14331437        self.browser.open(L110_student_path)
     1438        self.assertFalse('Edit' in self.browser.contents)
    14341439        self.assertTrue('Validate courses' in self.browser.contents)
    1435         # ... but a 100L CA does not see the button on other levels
     1440        # But a 100L CA does not see the button at other levels
    14361441        studylevel2 = StudentStudyLevel()
    14371442        studylevel2.level = 200
     
    14401445        L200_student_path = self.studycourse_path + '/200'
    14411446        self.browser.open(L200_student_path)
     1447        self.assertFalse('Edit' in self.browser.contents)
    14421448        self.assertFalse('Validate courses' in self.browser.contents)
    14431449        self.browser.open(L110_student_path)
     
    14711477        self.browser.getControl("Send message now").click()
    14721478        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)
    14731485        # The CA can't validate courses if not in state
    14741486        # courses registered
     
    20692081        self.browser.getControl("Register course list").click()
    20702082        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
    20722084        ctrl = self.browser.getControl(name='val_id')
    20732085        ctrl.getControl(value='COURSE1').selected = True
    20742086        self.browser.getControl("Remove selected", index=0).click()
    20752087        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.
    20772095        # We can do the same by adding the course on the manage page directly
    20782096        self.browser.getControl(name="course").value = 'COURSE1'
    20792097        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)
    20802104        # Course list can be registered
    20812105        self.browser.getControl("Register course list").click()
Note: See TracChangeset for help on using the changeset viewer.