Changeset 8322 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 2 May 2012, 06:58:29 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/accesscode.py
r8321 r8322 588 588 return fire_transition(access_code, 'reenable', comment=comment) 589 589 590 def create_accesscode(batch_prefix, batch_num, owner):590 def create_accesscode(batch_prefix, batch_num, cost, owner): 591 591 """ 592 592 """ … … 598 598 rand_num = list(batch.getNewRandomNum())[0] 599 599 num = len(batch) + 1 600 batch.addAccessCode(num, rand_num, owner)600 batch.addAccessCode(num, rand_num, cost, owner) 601 601 batch.entry_num += 1 602 602 pin = u'%s-%s-%s' % (batch_prefix,batch_num,rand_num) -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8268 r8322 1152 1152 if self.context.p_category == 'clearance': 1153 1153 # Create CLR access code 1154 pin, error = create_accesscode('CLR',0,student.student_id) 1154 pin, error = create_accesscode( 1155 'CLR',0,self.context.amount_auth,student.student_id) 1155 1156 if error: 1156 1157 self.flash(_('Valid callback received. ${a}', … … 1160 1161 elif self.context.p_category == 'schoolfee': 1161 1162 # Create SFE access code 1162 pin, error = create_accesscode('SFE',0,student.student_id) 1163 pin, error = create_accesscode( 1164 'SFE',0,self.context.amount_auth,student.student_id) 1163 1165 if error: 1164 1166 self.flash(_('Valid callback received. ${a}', … … 1168 1170 elif self.context.p_category == 'bed_allocation': 1169 1171 # Create HOS access code 1170 pin, error = create_accesscode('HOS',0,student.student_id) 1172 pin, error = create_accesscode( 1173 'HOS',0,self.context.amount_auth,student.student_id) 1171 1174 if error: 1172 1175 self.flash(_('Valid callback received. ${a}', -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8307 r8322 175 175 configuration = createObject('waeup.SessionConfiguration') 176 176 configuration.academic_session = 2004 177 configuration.clearance_fee = 3456.0 177 178 self.app['configuration'].addSessionConfiguration(configuration) 178 179 … … 1294 1295 self.browser.contents) 1295 1296 1297 # The authorized amount has been stored in the access code 1298 self.assertEqual( 1299 self.app['accesscodes']['SFE-0'].values()[0].cost,40000.0) 1300 1296 1301 # Callback can't be applied twice 1297 1302 self.browser.open(payment_url + '/simulate_callback') … … 1349 1354 pin = self.app['accesscodes']['CLR-0'].keys()[0] 1350 1355 ac = self.app['accesscodes']['CLR-0'][pin] 1351 ac.owner = self.student_id 1356 self.assertEqual(ac.owner, self.student_id) 1357 self.assertEqual(ac.cost, 3456.0) 1352 1358 return 1353 1359 … … 1384 1390 pin = self.app['accesscodes']['CLR-0'].keys()[0] 1385 1391 ac = self.app['accesscodes']['CLR-0'][pin] 1386 ac.owner = self.student_id 1392 self.assertEqual(ac.owner, self.student_id) 1393 self.assertEqual(ac.cost, 3456.0) 1387 1394 1388 1395 # Students can open the pdf payment slip … … 1493 1500 pin = self.app['accesscodes']['HOS-0'].keys()[0] 1494 1501 ac = self.app['accesscodes']['HOS-0'][pin] 1495 ac.owner = self.student_id1502 self.assertEqual(ac.owner, self.student_id) 1496 1503 parts = pin.split('-')[1:] 1497 1504 sfeseries, sfenumber = parts … … 1622 1629 pin = self.app['accesscodes']['HOS-0'].keys()[0] 1623 1630 ac = self.app['accesscodes']['HOS-0'][pin] 1624 ac.owner = u'Anybody'1625 1631 parts = pin.split('-')[1:] 1626 1632 sfeseries, sfenumber = parts … … 1640 1646 self.assertMatches('...Activation code is invalid...', 1641 1647 self.browser.contents) 1648 ac.owner = u'Anybody' 1642 1649 self.browser.getControl(name="ac_series").value = sfeseries 1643 1650 self.browser.getControl(name="ac_number").value = sfenumber
Note: See TracChangeset for help on using the changeset viewer.