Changeset 9699


Ignore:
Timestamp:
20 Nov 2012, 09:34:47 (12 years ago)
Author:
Henrik Bettermann
Message:

Students are allowed to remove mandatory course tickets.

Location:
main/waeup.futminna/trunk/src/waeup/futminna/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna/students/studylevel.py

    r9694 r9699  
    6464    grok.provides(ICustomCourseTicket)
    6565
     66    @property
     67    def removable_by_student(self):
     68        return True
     69
    6670CustomCourseTicket = attrs_to_fields(CustomCourseTicket)
    6771
  • main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py

    r9524 r9699  
    259259          'Add previous session payment ticket' in self.browser.contents)
    260260        return
     261
     262    def test_student_course_registration(self):
     263        IWorkflowState(self.student).setState('school fee paid')
     264        self.student['studycourse'].certificate = self.certificate
     265        self.browser.open(self.login_path)
     266        self.browser.getControl(name="form.login").value = self.student_id
     267        self.browser.getControl(name="form.password").value = 'spwd'
     268        self.browser.getControl("Login").click()
     269        self.browser.getLink("Study Course").click()
     270        self.browser.getLink("Add course list").click()
     271        self.assertMatches('...Add current level 100 (Year 1)...',
     272                           self.browser.contents)
     273        self.browser.getControl("Create course list now").click()
     274        # A level with one course ticket was created
     275        self.assertEqual(self.student['studycourse']['100'].number_of_tickets, 1)
     276        # Even if course is mandatory, students can remove the course
     277        self.student['studycourse']['100']['COURSE1'].mandatory = True
     278        self.browser.getLink("100").click()
     279        self.browser.getLink("Edit course list").click()
     280        ctrl = self.browser.getControl(name='val_id')
     281        ctrl.getControl(value='COURSE1').selected = True
     282        self.browser.getControl("Remove selected", index=0).click()
     283        self.assertTrue('Successfully removed' in self.browser.contents)
     284        return
Note: See TracChangeset for help on using the changeset viewer.