Ignore:
Timestamp:
28 Sep 2012, 19:47:52 (12 years ago)
Author:
Henrik Bettermann
Message:

Protect StudyLevelEditFormPage? and CourseTicketAddFormPage2. Students are not allowed to edit study levels which are not current.

File:
1 edited

Legend:

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

    r9255 r9257  
    20632063                        'K1000000 - account activated' in logcontent)
    20642064
    2065     def test_student_transfer(self):
     2065    def test_student_locked_level_forms(self):
     2066
     2067        # Add two study levels, one current and one previous
     2068        studylevel = createObject(u'waeup.StudentStudyLevel')
     2069        studylevel.level = 100
     2070        self.student['studycourse'].addStudentStudyLevel(
     2071            self.certificate, studylevel)
     2072        studylevel = createObject(u'waeup.StudentStudyLevel')
     2073        studylevel.level = 200
     2074        self.student['studycourse'].addStudentStudyLevel(
     2075            self.certificate, studylevel)
     2076        IWorkflowState(self.student).setState('school fee paid')
     2077        self.student['studycourse'].current_level = 200
     2078
     2079        self.browser.open(self.login_path)
     2080        self.browser.getControl(name="form.login").value = self.student_id
     2081        self.browser.getControl(name="form.password").value = 'spwd'
     2082        self.browser.getControl("Login").click()
     2083
     2084        self.browser.open(self.student_path + '/studycourse/200/edit')
     2085        self.assertFalse('The requested form is locked' in self.browser.contents)
     2086        self.browser.open(self.student_path + '/studycourse/100/edit')
     2087        self.assertTrue('The requested form is locked' in self.browser.contents)
     2088
     2089        self.browser.open(self.student_path + '/studycourse/200/ctadd')
     2090        self.assertFalse('The requested form is locked' in self.browser.contents)
     2091        self.browser.open(self.student_path + '/studycourse/100/ctadd')
     2092        self.assertTrue('The requested form is locked' in self.browser.contents)
     2093
     2094        IWorkflowState(self.student).setState('courses registered')
     2095        self.browser.open(self.student_path + '/studycourse/200/edit')
     2096        self.assertTrue('The requested form is locked' in self.browser.contents)
     2097        self.browser.open(self.student_path + '/studycourse/200/ctadd')
     2098        self.assertTrue('The requested form is locked' in self.browser.contents)
     2099
     2100
     2101    def test_manage_student_transfer(self):
    20662102        # Add second certificate
    20672103        self.certificate2 = createObject('waeup.Certificate')
     
    20762112        studylevel = createObject(u'waeup.StudentStudyLevel')
    20772113        studylevel.level = 200
     2114        self.student['studycourse'].addStudentStudyLevel(
     2115            self.certificate, studylevel)
     2116        studylevel = createObject(u'waeup.StudentStudyLevel')
     2117        studylevel.level = 999
    20782118        self.student['studycourse'].addStudentStudyLevel(
    20792119            self.certificate, studylevel)
     
    21042144        # Add study level to new study course
    21052145        studylevel = createObject(u'waeup.StudentStudyLevel')
    2106         studylevel.level = 200
     2146        studylevel.level = 999
    21072147        self.student['studycourse'].addStudentStudyLevel(
    21082148            self.certificate, studylevel)
     
    21252165        self.assertTrue('The requested form is locked' in self.browser.contents)
    21262166
    2127         self.browser.open(self.student_path + '/studycourse/200/manage')
     2167        self.browser.open(self.student_path + '/studycourse/999/manage')
    21282168        self.assertFalse('The requested form is locked' in self.browser.contents)
    2129         self.browser.open(self.student_path + '/studycourse_1/200/manage')
     2169        self.browser.open(self.student_path + '/studycourse_1/999/manage')
    21302170        self.assertTrue('The requested form is locked' in self.browser.contents)
    21312171
    2132         self.browser.open(self.student_path + '/studycourse/200/validate_courses')
     2172        self.browser.open(self.student_path + '/studycourse/999/validate_courses')
    21332173        self.assertFalse('The requested form is locked' in self.browser.contents)
    2134         self.browser.open(self.student_path + '/studycourse_1/200/validate_courses')
     2174        self.browser.open(self.student_path + '/studycourse_1/999/validate_courses')
    21352175        self.assertTrue('The requested form is locked' in self.browser.contents)
    21362176
    2137         self.browser.open(self.student_path + '/studycourse/200/reject_courses')
     2177        self.browser.open(self.student_path + '/studycourse/999/reject_courses')
    21382178        self.assertFalse('The requested form is locked' in self.browser.contents)
    2139         self.browser.open(self.student_path + '/studycourse_1/200/reject_courses')
     2179        self.browser.open(self.student_path + '/studycourse_1/999/reject_courses')
    21402180        self.assertTrue('The requested form is locked' in self.browser.contents)
    21412181
    2142         self.browser.open(self.student_path + '/studycourse/200/add')
     2182        self.browser.open(self.student_path + '/studycourse/999/add')
    21432183        self.assertFalse('The requested form is locked' in self.browser.contents)
    2144         self.browser.open(self.student_path + '/studycourse_1/200/add')
     2184        self.browser.open(self.student_path + '/studycourse_1/999/add')
    21452185        self.assertTrue('The requested form is locked' in self.browser.contents)
    21462186
    2147         self.browser.open(self.student_path + '/studycourse/200/edit')
     2187        self.browser.open(self.student_path + '/studycourse/999/edit')
    21482188        self.assertFalse('The requested form is locked' in self.browser.contents)
    2149         self.browser.open(self.student_path + '/studycourse_1/200/edit')
     2189        self.browser.open(self.student_path + '/studycourse_1/999/edit')
    21502190        self.assertTrue('The requested form is locked' in self.browser.contents)
    21512191
Note: See TracChangeset for help on using the changeset viewer.