Changeset 8981 for main/waeup.futminna/trunk/src/waeup/futminna/students
- Timestamp:
- 12 Jul 2012, 08:53:27 (12 years ago)
- Location:
- main/waeup.futminna/trunk/src/waeup/futminna
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna
- Property svn:mergeinfo changed
/main/waeup.fceokene/trunk/src/waeup/fceokene merged: 8979 /main/waeup.uniben/trunk/src/waeup/uniben merged: 8959
- Property svn:mergeinfo changed
-
main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py
r8907 r8981 152 152 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 153 153 self.browser.getControl("Create ticket").click() 154 self.assertMatches('...Session configuration object is not...', 155 self.browser.contents) 156 # Uups, we forgot to add a session configuration for next session 157 configuration = createObject('waeup.SessionConfiguration') 158 configuration.academic_session = 2005 159 self.app['configuration'].addSessionConfiguration(configuration) 160 self.browser.open(self.payments_path + '/addop') 161 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 162 self.browser.getControl("Create ticket").click() 154 163 self.assertMatches('...ticket created...', 155 164 self.browser.contents) … … 188 197 utils = getUtility(IStudentsUtils) 189 198 199 configuration = createObject('waeup.SessionConfiguration') 200 configuration.academic_session = 2005 201 self.app['configuration'].addSessionConfiguration(configuration) 202 190 203 error, payment = utils.setPaymentDetails('schoolfee',self.student) 191 204 self.assertEqual(payment, None) … … 200 213 self.assertEqual(error, None) 201 214 202 # Add penalty fee. 215 # Add penalty fee ... 216 # ... for cleared 203 217 self.app['configuration']['2004'].penalty_ug = 99.0 218 # ... for returning 219 self.app['configuration']['2005'].penalty_ug = 88.0 204 220 error, payment = utils.setPaymentDetails('schoolfee',self.student) 205 221 self.assertEqual(payment.amount_auth, 40099.0) … … 209 225 self.assertEqual(payment.p_level, 200) 210 226 self.assertEqual(payment.p_session, 2005) 211 self.assertEqual(payment.amount_auth, 200 99.0)227 self.assertEqual(payment.amount_auth, 20088.0) 212 228 self.assertEqual(payment.p_item, u'CERT1') 213 229 self.assertEqual(error, None) -
main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py
r8952 r8981 97 97 p_session, p_level = self.getReturningData(student) 98 98 amount = getattr(certificate, 'school_fee_2', 0.0) 99 try: 100 academic_session = grok.getSite()[ 101 'configuration'][str(p_session)] 102 except KeyError: 103 return _(u'Session configuration object is not available.'), None 99 104 elif student.is_postgrad and student.state == PAID: 100 105 # Returning postgraduate students also pay for the next session … … 102 107 p_session += 1 103 108 amount = getattr(certificate, 'school_fee_2', 0.0) 109 try: 110 academic_session = grok.getSite()[ 111 'configuration'][str(p_session)] 112 except KeyError: 113 return _(u'Session configuration object is not available.'), None 104 114 if amount in (0.0, None): 105 115 return _(u'Amount could not be determined.'), None
Note: See TracChangeset for help on using the changeset viewer.