Changeset 13816
- Timestamp:
- 8 Apr 2016, 05:26:51 (9 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests/test_browser.py
r13814 r13816 30 30 from waeup.uniben.configuration import CustomSessionConfiguration 31 31 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup, PH_LEN 32 33 session_1 = datetime.now().year - 2 34 SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg') 32 35 33 36 class CustomApplicantUITests(ApplicantsFullSetup): … … 227 230 print "Sample nils_application_slip.pdf written to %s" % path 228 231 229 def test_ictwk_application _slip(self):232 def test_ictwk_application(self): 230 233 231 234 # Remove required FieldProperty attribute first ... … … 243 246 #self.browser.getControl(name="form.sex").value = ['m'] 244 247 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 248 image = open(SAMPLE_IMAGE, 'rb') 249 ctrl = self.browser.getControl(name='form.passport') 250 file_ctrl = ctrl.mech_control 251 file_ctrl.add_file(image, filename='myphoto.jpg') 245 252 self.browser.getControl("Save").click() 246 253 self.applicant.registration_cats = ['group', 'corporate'] 254 IWorkflowState(self.applicant).setState('started') 255 configuration = CustomSessionConfiguration() 256 configuration.academic_session = session_1 257 configuration.application_fee = 0.0 258 self.app['configuration'].addSessionConfiguration(configuration) 259 self.browser.getControl("Add online payment ticket").click() 260 self.assertMatches('...Payment ticket created...', 261 self.browser.contents) 262 self.assertEqual(self.applicant.values()[0].amount_auth, 450000) 247 263 IWorkflowState(self.applicant).setState('submitted') 248 264 self.browser.open(self.view_path) -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py
r13815 r13816 19 19 """ 20 20 21 import grok 22 from time import time 21 23 from kofacustom.nigeria.applicants.utils import NigeriaApplicantsUtils 22 24 from waeup.kofa.applicants.workflow import (INITIALIZED, 23 25 STARTED, PAID, ADMITTED, NOT_ADMITTED, SUBMITTED, CREATED) 26 from waeup.uniben.applicants.interfaces import REGISTRATION_CATS 24 27 from waeup.uniben.interfaces import MessageFactory as _ 25 26 27 28 28 29 class CustomApplicantsUtils(NigeriaApplicantsUtils): … … 90 91 fee_name = applicant.special_application + '_fee' 91 92 payment.amount_auth = getattr(session_config, fee_name, None) 92 if payment.amount_auth in (0.0, None):93 return _('Amount could not be determined.')94 93 payment.p_category = applicant.special_application 95 94 return 96 payment.p_category = 'application' 97 container_fee = container.application_fee 98 if container_fee: 99 payment.amount_auth = container_fee 100 return 101 payment.amount_auth = session_config.application_fee 95 elif applicant.__parent__.prefix == 'ictwk': 96 payment.p_category = 'registration' 97 for cat in applicant.registration_cats: 98 payment.amount_auth += REGISTRATION_CATS[cat][1] 99 else: 100 payment.p_category = 'application' 101 container_fee = container.application_fee 102 if container_fee: 103 payment.amount_auth = container_fee 104 return 105 payment.amount_auth = session_config.application_fee 102 106 if payment.amount_auth in (0.0, None): 103 107 return _('Amount could not be determined.') 104 108 return 105 -
main/waeup.uniben/trunk/src/waeup/uniben/utils/utils.py
r13785 r13816 82 82 'admission_checking': 'Admission Checking Fee', 83 83 'jupeb': 'JUPEB Examination Fee', 84 'registration': 'Registration Fee' 84 85 } 85 86
Note: See TracChangeset for help on using the changeset viewer.