Ignore:
Timestamp:
24 Oct 2012, 05:58:57 (12 years ago)
Author:
Henrik Bettermann
Message:

Customize SPECIAL_HANDLING_DICT and getAccommodationDetails.

File:
1 edited

Legend:

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

    r9298 r9402  
    2525from zope.interface import verify
    2626from waeup.kofa.app import University
     27from waeup.kofa.university.faculty import Faculty
     28from waeup.kofa.university.department import Department
    2729from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    2830from waeup.kofa.testing import FunctionalTestCase
     
    7072    layer = FunctionalLayer
    7173
     74    def setUp(self):
     75        super(StudentUITests, self).setUp()
     76
     77        # Create SSE faculty with certificate
     78        self.app['faculties']['SSE'] = Faculty(code='SSE')
     79        self.app['faculties']['SSE']['dep1'] = Department(code='dep1')
     80        self.certificate2 = createObject('waeup.Certificate')
     81        self.certificate2.code = u'CERT2'
     82        self.certificate2.application_category = 'basic'
     83        self.certificate2.study_mode = 'ug_ft'
     84        self.certificate2.start_level = 100
     85        self.certificate2.end_level = 300
     86        self.app['faculties']['SSE']['dep1'].certificates.addCertificate(
     87            self.certificate2)
     88        # Set study course attributes of test student
     89        self.student['studycourse'].certificate = self.certificate2
     90        self.student['studycourse'].current_session = 2004
     91        self.student['studycourse'].entry_session = 2004
     92        self.student['studycourse'].current_verdict = 'A'
     93        self.student['studycourse'].current_level = 100
     94
    7295    def test_get_returning_data(self):
    7396        # Student is in level 100, session 2004 with verdict A
     
    99122        self.assertEqual(payment.p_session, 2004)
    100123        self.assertEqual(payment.amount_auth, 37000.0)
    101         self.assertEqual(payment.p_item, u'CERT1')
     124        self.assertEqual(payment.p_item, u'CERT2')
    102125        self.assertEqual(error, None)
    103126
    104         self.certificate.study_mode = 'jm_ft'
     127        self.certificate2.study_mode = 'jm_ft'
    105128        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    106129        self.assertEqual(payment.amount_auth, 72700.0)
     
    111134        self.assertEqual(payment.p_session, 2005)
    112135        self.assertEqual(payment.amount_auth, 37000.0)
    113         self.assertEqual(payment.p_item, u'CERT1')
     136        self.assertEqual(payment.p_item, u'CERT2')
    114137        self.assertEqual(error, None)
    115138
    116         self.certificate.study_mode = 'ug_ft'
     139        self.certificate2.study_mode = 'ug_ft'
    117140        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    118141        self.assertEqual(payment.amount_auth, 20000.0)
    119 
    120142
    121143        error, payment = utils.setPaymentDetails('clearance',self.student)
     
    123145        self.assertEqual(payment.p_session, 2004)
    124146        self.assertEqual(payment.amount_auth, 20000.0)
    125         self.assertEqual(payment.p_item, u'CERT1')
     147        self.assertEqual(payment.p_item, u'CERT2')
    126148        self.assertEqual(error, None)
    127149
     
    129151        self.assertEqual(error, u'Previous session payment not yet implemented.')
    130152        return
     153
     154    def test_get_accommodation_details(self):
     155        self.app['configuration']['2004'].gown_fee = 150.0
     156        self.app['configuration']['2004'].transfer_fee = 90.0
     157        self.app['configuration']['2004'].booking_fee = 150.0
     158        self.app['configuration']['2004'].maint_fee = 180.0
     159        self.app['configuration']['2004'].clearance_fee = 120.0
     160        utils = getUtility(IStudentsUtils)
     161
     162        details = utils.getAccommodationDetails(self.student)
     163        self.assertEqual(details['bt'], u'sse_male_fr')
Note: See TracChangeset for help on using the changeset viewer.