Changeset 10157


Ignore:
Timestamp:
7 May 2013, 19:12:39 (11 years ago)
Author:
Henrik Bettermann
Message:

In AAUA we have special postgrad students like in Uniben.

Location:
main/waeup.aaua/trunk/src/waeup/aaua
Files:
4 edited

Legend:

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

    r10120 r10157  
    6868    def dataNotComplete(self):
    6969        return False
    70 
    71 class BedTicketAddPage(BedTicketAddPage):
    72     """ Page to add an online payment ticket
    73     """
    74     buttonname = _('Create bed ticket')
    75     notice = ''
    76     with_ac = False
  • main/waeup.aaua/trunk/src/waeup/aaua/students/studycourse.py

    r10120 r10157  
    3535    grok.provides(ICustomStudentStudyCourse)
    3636
     37    @property
     38    def is_postgrad(self):
     39        if self.certificate is None:
     40            return False
     41        return self.certificate.study_mode.startswith('pg') or \
     42            self.certificate.study_mode.startswith('special_pg')
     43
     44    @property
     45    def is_special_postgrad(self):
     46        if self.certificate is None:
     47            return False
     48        return self.certificate.study_mode.startswith('special_pg')
     49
     50
    3751CustomStudentStudyCourse = attrs_to_fields(CustomStudentStudyCourse)
    3852
  • main/waeup.aaua/trunk/src/waeup/aaua/students/tests/test_browser.py

    r10120 r10157  
    8282        self.student['accommodation'].addBedTicket(bedticket)
    8383
    84 
    85 
    8684    def test_student_start_clearance(self):
    8785        self.browser.open(self.login_path)
     
    9997            name='upload_passportuploadedit').click()
    10098        self.browser.open(self.student_path + '/start_clearance')
    101         # In Okene the students can just start clearance without entering
     99        # In AAUA the students can just start clearance without entering
    102100        # an activation code.
    103101        self.browser.getControl("Start clearance now").click()
     
    105103                           self.browser.contents)
    106104
    107     def test_student_accommodation(self):
    108         del self.student['accommodation']['2004']
    109         # Login
    110         self.browser.open(self.login_path)
    111         self.browser.getControl(name="form.login").value = self.student_id
    112         self.browser.getControl(name="form.password").value = 'spwd'
    113         self.browser.getControl("Login").click()
    114 
    115         # Students can book accommodation without AC ...
    116         self.browser.open(self.acco_path)
    117         IWorkflowInfo(self.student).fireTransition('admit')
    118         self.browser.getLink("Book accommodation").click()
    119         self.assertFalse('Activation Code:' in self.browser.contents)
    120         self.browser.getControl("Create bed ticket").click()
    121         # Bed is randomly selected but, since there is only
    122         # one bed for this student, we know that
    123         self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
    124                            self.browser.contents)
    125         return
     105    def test_next_session_allowed(self):
     106        # Let's see if next_session_allowed works as expected
     107        # A, ug_ft, 100
     108        IWorkflowState(self.student).setState('returning')
     109        self.assertTrue(self.student['studycourse'].next_session_allowed)
     110        # Uniben special PG programmes have the same workflow
     111        # as UG students
     112        self.certificate.study_mode = 'special_pg'
     113        self.assertTrue(self.student['studycourse'].next_session_allowed)
     114        IWorkflowState(self.student).setState('school fee paid')
     115        self.assertFalse(self.student['studycourse'].next_session_allowed)
     116        # Now we convert the certificate into a 'regular
     117        # postgraduate certificate ...
     118        self.certificate.study_mode = 'pg_xx'
     119        # ... and voila next session registration is allowed
     120        self.assertTrue(self.student['studycourse'].next_session_allowed)
  • main/waeup.aaua/trunk/src/waeup/aaua/utils/utils.py

    r10154 r10157  
    5151        'pg_ft': 'Postgraduate Full Time',
    5252        'pg_pt': 'Postgraduate Part Time',
     53        'special_pg': 'Special Postgraduate',
    5354        'pg_sw': 'Postgraduate Sandwich',
    5455        'ug_sw': 'Undergraduate Sandwich',
Note: See TracChangeset for help on using the changeset viewer.