Changeset 11575 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 4 Apr 2014, 05:59:43 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r11570 r11575 630 630 631 631 def update(self): 632 for key in self.context.keys(): 633 ticket = self.context[key] 634 if ticket.p_state == 'paid': 635 self.flash( 636 _('This type of payment has already been made.'), 637 type='warning') 638 self.redirect(self.url(self.context)) 639 return 632 if not self.context.special: 633 for key in self.context.keys(): 634 ticket = self.context[key] 635 if ticket.p_state == 'paid': 636 self.flash( 637 _('This type of payment has already been made.'), 638 type='warning') 639 self.redirect(self.url(self.context)) 640 return 640 641 applicants_utils = getUtility(IApplicantsUtils) 641 642 container = self.context.__parent__ -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py
r11570 r11575 44 44 """Process applicant after payment was approved. 45 45 """ 46 wf_info = IWorkflowInfo(self.__parent__) 47 try: 48 wf_info.fireTransition('approve') 49 except InvalidTransitionError: 50 msg = log = 'Error: %s' % sys.exc_info()[1] 51 return msg, log 46 if not self.__parent__.special: 47 wf_info = IWorkflowInfo(self.__parent__) 48 try: 49 wf_info.fireTransition('approve') 50 except InvalidTransitionError: 51 msg = log = 'Error: %s' % sys.exc_info()[1] 52 return msg, log 52 53 log = 'payment approved: %s' % self.p_id 53 54 msg = _('Payment approved') … … 57 58 """Process applicant after payment was made. 58 59 """ 59 wf_info = IWorkflowInfo(self.__parent__) 60 try: 61 wf_info.fireTransition('pay') 62 except InvalidTransitionError: 63 msg = log = 'Error: %s' % sys.exc_info()[1] 64 return msg, log 60 if not self.__parent__.special: 61 wf_info = IWorkflowInfo(self.__parent__) 62 try: 63 wf_info.fireTransition('pay') 64 except InvalidTransitionError: 65 msg = log = 'Error: %s' % sys.exc_info()[1] 66 return msg, log 65 67 log = 'successful payment: %s' % self.p_id 66 68 msg = _('Successful payment') -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r11253 r11575 943 943 configuration.academic_session = session_1 944 944 configuration.transcript_fee = 200.0 945 configuration.clearance_fee = 300.0 945 946 self.app['configuration'].addSessionConfiguration(configuration) 946 947 … … 974 975 self.assertTrue( 975 976 '<span>200.0</span>' in self.browser.contents) 976 self.browser.getLink("Logout").click() 977 # Login as manager 978 #self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 979 #self.browser.open(applicant_path + '/manage') 980 # When unselecting special_application, the payment ticket 981 # can still be created. 982 #self.browser.getControl(name="form.special_application").value = [ 983 # ''] 984 #self.browser.getControl("Save").click() 985 #self.browser.getControl("Add online payment ticket").click() 986 #self.assertMatches('...Payment ticket created...', 987 # self.browser.contents) 988 #self.assertMatches('...<span>--</span>...', 989 # self.browser.contents) 977 self.assertEqual(len(self.special_applicant.keys()), 1) 978 # The applicant's workflow remain started ... 979 self.special_applicant.values()[0].approveApplicantPayment() 980 self.assertEqual(self.special_applicant.state, 'started') 981 self.browser.open(applicant_path + '/edit') 982 # ... so that he can create further tickets. 983 self.browser.getControl(name="form.special_application").value = [ 984 'clearance'] 985 self.browser.getControl("Save").click() 986 self.browser.getControl("Add online payment ticket").click() 987 self.assertMatches('...Payment ticket created...', 988 self.browser.contents) 989 self.browser.open(applicant_path) 990 self.assertTrue( 991 '<td>Acceptance Fee</td>' in self.browser.contents) 992 self.assertEqual(len(self.special_applicant.keys()), 2) 990 993 return 991 994 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py
r11254 r11575 56 56 payment.p_session = container.year 57 57 payment.amount_auth = 0.0 58 if container.prefix.startswith('special'):58 if applicant.special: 59 59 if applicant.special_application: 60 60 fee_name = applicant.special_application + '_fee' -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r11451 r11575 159 159 SPECIAL_APP_DICT = { 160 160 'transcript': 'Transcript Fee Payment', 161 'clearance': 'Acceptance Fee', 161 162 } 162 163
Note: See TracChangeset for help on using the changeset viewer.