Ignore:
Timestamp:
28 Sep 2012, 08:21:08 (12 years ago)
Author:
Henrik Bettermann
Message:

Postgraduate students must not register their course lists.

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

Legend:

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

    r9217 r9252  
    20582058    @action(_('Register course list'), style='primary')
    20592059    def registerCourses(self, **data):
     2060        if self.context.student.is_postgrad:
     2061            self.flash(_(
     2062                "You are a postgraduate student, "
     2063                "your course list can't bee registered."))
     2064            self.redirect(self.url(self.context))
     2065            return
    20602066        if self.total_credits > self.max_credits:
    20612067            self.flash(_('Maximum credits of ${a} exceeded.',
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9238 r9252  
    13221322        return
    13231323
     1324    def test_postgraduate_student_access(self):
     1325        self.certificate.study_mode = 'pg_ft'
     1326        self.certificate.start_level = 999
     1327        self.certificate.end_level = 999
     1328        self.student['studycourse'].current_level = 999
     1329        IWorkflowState(self.student).setState('school fee paid')
     1330        self.certificate.study_mode = 'pg_ft'
     1331        self.browser.open(self.login_path)
     1332        self.browser.getControl(name="form.login").value = self.student_id
     1333        self.browser.getControl(name="form.password").value = 'spwd'
     1334        self.browser.getControl("Login").click()
     1335        self.assertTrue(
     1336            'You logged in.' in self.browser.contents)
     1337        # Now students can add the current study level
     1338        self.browser.getLink("Study Course").click()
     1339        self.browser.getLink("Add course list").click()
     1340        self.assertMatches('...Add current level Postgraduate Level...',
     1341                           self.browser.contents)
     1342        self.browser.getControl("Create course list now").click()
     1343        # A level with one course ticket was created
     1344        self.assertEqual(self.student['studycourse']['999'].number_of_tickets, 0)
     1345        self.browser.getLink("999").click()
     1346        self.browser.getLink("Edit course list").click()
     1347        self.browser.getControl("Add course ticket").click()
     1348        self.browser.getControl(name="form.course").value = ['COURSE1']
     1349        self.browser.getControl("Add course ticket").click()
     1350        self.assertMatches('...Successfully added COURSE1...',
     1351                           self.browser.contents)
     1352        # Postgraduate students can't register course lists
     1353        self.browser.getControl("Register course list").click()
     1354        self.assertTrue("your course list can't bee registered"
     1355            in self.browser.contents)
     1356        self.assertEqual(self.student.state, 'school fee paid')
     1357        return
     1358
    13241359    def test_student_clearance_wo_clrcode(self):
    13251360        IWorkflowState(self.student).setState('clearance started')
     
    16531688        return
    16541689
    1655     def test_student_postgraduate_payments(self):
     1690    def test_postgraduate_student_payments(self):
    16561691        self.certificate.study_mode = 'pg_ft'
    16571692        self.certificate.start_level = 999
Note: See TracChangeset for help on using the changeset viewer.