Changeset 8703 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 13 Jun 2012, 06:32:13 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py
r8702 r8703 27 27 from waeup.kofa.interfaces import MessageFactory as _ 28 28 from waeup.kofa.payments import OnlinePayment 29 from waeup.kofa.payments.interfaces import IPaymentWebservice 29 30 from waeup.kofa.applicants.interfaces import IApplicantOnlinePayment 30 31 from waeup.kofa.utils.helpers import attrs_to_fields … … 74 75 return self.doAfterApplicantPaymentApproval() 75 76 76 def getOwner(self): 77 """Return applicant. 78 """ 79 return self.__parent__ 77 ApplicantOnlinePayment = attrs_to_fields(ApplicantOnlinePayment) 80 78 81 ApplicantOnlinePayment = attrs_to_fields(ApplicantOnlinePayment) 79 class PaymentWebservice(grok.Adapter): 80 """An adapter to publish applicant data through a webservice. 81 """ 82 grok.context(IApplicantOnlinePayment) 83 grok.implements(IPaymentWebservice) 84 85 @property 86 def payee(self): 87 return self.context.__parent__.display_fullname 82 88 83 89 # Applicant online payments must be importable. So we might need a factory. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r8702 r8703 35 35 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 36 36 from waeup.kofa.app import University 37 from waeup.kofa.payments.interfaces import IPaymentWebservice 37 38 from waeup.kofa.configuration import SessionConfiguration 38 39 from waeup.kofa.applicants.container import ApplicantsContainer … … 730 731 self.assertEqual(payment.p_category,'application') 731 732 self.assertEqual(payment.amount_auth,200.0) 732 # Applicant is ownerof the payment ticket.733 self.assertEqual( payment.getOwner(), self.applicant)733 # Applicant is payee of the payment ticket. 734 self.assertEqual(IPaymentWebservice(payment).payee, 'John Tester') 734 735 # The pdf payment slip can't yet be opened 735 736 #self.browser.open(payment_url + '/payment_receipt.pdf')
Note: See TracChangeset for help on using the changeset viewer.