- Timestamp:
- 24 Oct 2012, 05:58:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py
r9298 r9402 25 25 from zope.interface import verify 26 26 from waeup.kofa.app import University 27 from waeup.kofa.university.faculty import Faculty 28 from waeup.kofa.university.department import Department 27 29 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 28 30 from waeup.kofa.testing import FunctionalTestCase … … 70 72 layer = FunctionalLayer 71 73 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 72 95 def test_get_returning_data(self): 73 96 # Student is in level 100, session 2004 with verdict A … … 99 122 self.assertEqual(payment.p_session, 2004) 100 123 self.assertEqual(payment.amount_auth, 37000.0) 101 self.assertEqual(payment.p_item, u'CERT 1')124 self.assertEqual(payment.p_item, u'CERT2') 102 125 self.assertEqual(error, None) 103 126 104 self.certificate .study_mode = 'jm_ft'127 self.certificate2.study_mode = 'jm_ft' 105 128 error, payment = utils.setPaymentDetails('schoolfee',self.student) 106 129 self.assertEqual(payment.amount_auth, 72700.0) … … 111 134 self.assertEqual(payment.p_session, 2005) 112 135 self.assertEqual(payment.amount_auth, 37000.0) 113 self.assertEqual(payment.p_item, u'CERT 1')136 self.assertEqual(payment.p_item, u'CERT2') 114 137 self.assertEqual(error, None) 115 138 116 self.certificate .study_mode = 'ug_ft'139 self.certificate2.study_mode = 'ug_ft' 117 140 error, payment = utils.setPaymentDetails('schoolfee',self.student) 118 141 self.assertEqual(payment.amount_auth, 20000.0) 119 120 142 121 143 error, payment = utils.setPaymentDetails('clearance',self.student) … … 123 145 self.assertEqual(payment.p_session, 2004) 124 146 self.assertEqual(payment.amount_auth, 20000.0) 125 self.assertEqual(payment.p_item, u'CERT 1')147 self.assertEqual(payment.p_item, u'CERT2') 126 148 self.assertEqual(error, None) 127 149 … … 129 151 self.assertEqual(error, u'Previous session payment not yet implemented.') 130 152 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.