Ignore:
Timestamp:
28 Sep 2012, 06:22:59 (12 years ago)
Author:
Henrik Bettermann
Message:

In Uniben we have special pg students which follow the ug workflow.

See ticket 838:

Whereas the full time LLM students are to register all the four courses once, the part time LLM students are only permitted to register any two of the four courses in their first year and the remaining two courses including any carryover in the second or third year. Presently they do not have any problem with full time LLM online course registration but they certainly are not happy with the way LLM part time students are registering their cousres online as if they are full time students.

File:
1 edited

Legend:

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

    r9210 r9251  
    7373    layer = FunctionalLayer
    7474
     75    def test_next_session_allowed(self):
     76        # Let's see if next_session_allowed works as expected
     77        # A, ug_ft, 100
     78        IWorkflowState(self.student).setState('returning')
     79        self.assertTrue(self.student['studycourse'].next_session_allowed)
     80        # Uniben special PG programmes have the same workflow
     81        # as UG students
     82        self.certificate.study_mode = 'special_pg_pt'
     83        self.assertTrue(self.student['studycourse'].next_session_allowed)
     84        IWorkflowState(self.student).setState('school fee paid')
     85        self.assertFalse(self.student['studycourse'].next_session_allowed)
     86        # Now we convert the certificate into a 'regular
     87        # postgraduate certificate ...
     88        self.certificate.study_mode = 'pg_ft'
     89        # ... and voila next session registration is allowed
     90        self.assertTrue(self.student['studycourse'].next_session_allowed)
     91
     92    def test_manage_access(self):
     93        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     94        # The student created in the base package is a ug student
     95        self.browser.open(self.manage_clearance_path)
     96        self.assertMatches('...First Sitting Record...',
     97                           self.browser.contents)
     98        # There is no pg field in the clearance form
     99        self.assertFalse('Second Higher Education Record'
     100            in self.browser.contents)
     101        # Now we change the study mode ...
     102        self.certificate.study_mode = 'pg_ft'
     103        self.browser.open(self.clearance_path)
     104        # ... and additional pg clearance fields appear
     105        self.assertMatches('...Second Higher Education Record...',
     106                           self.browser.contents)
     107        # But also fields from the ug form are displayed
     108        self.assertMatches('...First Sitting Record...',
     109                           self.browser.contents)
     110        # The same holds for Uniben's special pg students
     111        self.certificate.study_mode = 'special_pg_ft'
     112        self.browser.open(self.clearance_path)
     113        self.assertMatches('...Second Higher Education Record...',
     114                           self.browser.contents)
     115        self.assertMatches('...First Sitting Record...',
     116                           self.browser.contents)
     117
    75118    def test_manage_payments(self):
    76119        # Add missing configuration data
     
    301344        self.assertEqual(payment.p_item, u'CERT1')
    302345        self.assertEqual(error, None)
    303 
    304346        self.student.is_staff = True
    305347        error, payment = utils.setPaymentDetails('schoolfee',
     
    332374        self.assertEqual(payment.p_session, 2005)
    333375        self.assertEqual(payment.amount_auth, 20088.0)
     376        self.assertEqual(payment.p_item, u'CERT1')
     377        self.assertEqual(error, None)
     378
     379        # In Uniben we have pg and special pg students.
     380        # They pay the same but their workflow is different.
     381        IWorkflowState(self.student).setState('school fee paid')
     382        self.student.is_staff = False
     383        self.student.nationality = u'NG'
     384        self.certificate.school_fee_2 = 10000.0
     385        error, payment = utils.setPaymentDetails(
     386            'schoolfee', self.student, None, None)
     387        self.assertEqual(payment, None)
     388        self.assertTrue('not be determined' in error)
     389        self.certificate.study_mode = 'pg_pt'
     390        self.assertTrue(self.student.is_postgrad)
     391        self.assertFalse(self.student.is_special_postgrad)
     392        error, payment = utils.setPaymentDetails(
     393            'schoolfee', self.student, None, None)
     394        self.assertEqual(payment.p_level, 100)
     395        self.assertEqual(payment.p_session, 2005)
     396        self.assertEqual(payment.amount_auth, 10000.0)
     397        self.assertEqual(payment.p_item, u'CERT1')
     398        self.assertEqual(error, None)
     399        self.certificate.study_mode = 'special_pg_pt'
     400        self.assertTrue(self.student.is_postgrad)
     401        self.assertTrue(self.student.is_special_postgrad)
     402        error, payment = utils.setPaymentDetails(
     403            'schoolfee', self.student, None, None)
     404        self.assertTrue('not be determined' in error)
     405        IWorkflowState(self.student).setState('returning')
     406        error, payment = utils.setPaymentDetails(
     407            'schoolfee', self.student, None, None)
     408        self.assertEqual(payment.p_level, 200)
     409        self.assertEqual(payment.p_session, 2005)
     410        self.assertEqual(payment.amount_auth, 10000.0)
    334411        self.assertEqual(payment.p_item, u'CERT1')
    335412        self.assertEqual(error, None)
Note: See TracChangeset for help on using the changeset viewer.