Changeset 11453 for main/waeup.kwarapoly/trunk/src/waeup/kwarapoly
- Timestamp:
- 27 Feb 2014, 10:57:32 (11 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
r11065 r11453 110 110 111 111 # In KwaraPoly only returning students can create school fee payment 112 # without hav eing paid accommodation fee112 # without having paid accommodation fee 113 113 IWorkflowState(self.student).setState('returning') 114 114 configuration = createObject('waeup.SessionConfiguration') … … 464 464 465 465 return 466 467 def test_payment_disabled(self): 468 IWorkflowState(self.student).setState('returning') 469 configuration = createObject('waeup.SessionConfiguration') 470 configuration.academic_session = 2005 471 self.app['configuration'].addSessionConfiguration(configuration) 472 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 473 self.browser.open(self.payments_path) 474 self.browser.getLink("Add current session payment ticket").click() 475 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 476 self.browser.getControl("Create ticket").click() 477 self.assertMatches('...ticket created...', 478 self.browser.contents) 479 self.app['configuration']['2005'].payment_disabled = ['sf_all'] 480 self.browser.getLink("Add current session payment ticket").click() 481 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 482 self.browser.getControl("Create ticket").click() 483 self.assertMatches('...Payment temporarily disabled...', 484 self.browser.contents) 485 self.app['configuration']['2005'].payment_disabled = ['sf_non_pg'] 486 # Non-PG students can't pay ... 487 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 488 self.browser.getControl("Create ticket").click() 489 self.assertMatches('...Payment temporarily disabled...', 490 self.browser.contents) 491 # ... but PG can pay. 492 self.certificate.study_mode = 'pg_ft' 493 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 494 self.browser.getControl("Create ticket").click() 495 self.assertMatches('...ticket created...', 496 self.browser.contents) 497 return -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py
r11065 r11453 152 152 # Bed has not yet been booked but beds are available. 153 153 return True 154 return False 155 156 def _isPaymentDisabled(self, p_session, category, student): 157 academic_session = self._getSessionConfiguration(p_session) 158 if category == 'schoolfee': 159 if 'sf_all' in academic_session.payment_disabled: 160 return True 161 if 'sf_non_pg' in academic_session.payment_disabled and \ 162 not student.is_postgrad: 163 return True 154 164 return False 155 165 … … 258 268 elif category == 'schoolfee': 259 269 amount += academic_session.penalty_ug 270 if self._isPaymentDisabled(p_session, category, student): 271 return _('Payment temporarily disabled.'), None 260 272 payment = createObject(u'waeup.StudentOnlinePayment') 261 273 timestamp = ("%d" % int(time()*10000))[1:] -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/utils/utils.py
r10844 r11453 102 102 } 103 103 104 DISABLE_PAYMENT_GROUP_DICT = { 105 'sf_all': 'School Fee - All Students', 106 'sf_non_pg': 'School Fee - Non-PG Students', 107 } 108 104 109 SPECIAL_HANDLING_DICT = { 105 110 'regular': 'Regular Hostel',
Note: See TracChangeset for help on using the changeset viewer.