Changeset 8703 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 13 Jun 2012, 06:32:13 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
r8702 r8703 26 26 IStudentPaymentsContainer, IStudentNavigation, IStudentOnlinePayment) 27 27 from waeup.kofa.payments import PaymentsContainer, OnlinePayment 28 from waeup.kofa.payments.interfaces import IPaymentWebservice 28 29 from waeup.kofa.utils.helpers import attrs_to_fields 29 30 from waeup.kofa.accesscodes import create_accesscode … … 59 60 except AttributeError: 60 61 return None 61 62 def getOwner(self):63 return self.getStudent()64 62 65 63 def doAfterStudentPayment(self): … … 132 130 StudentOnlinePayment = attrs_to_fields(StudentOnlinePayment) 133 131 132 class PaymentWebservice(grok.Adapter): 133 """An adapter to publish student data through a webservice. 134 """ 135 grok.context(IStudentOnlinePayment) 136 grok.implements(IPaymentWebservice) 137 138 @property 139 def payee(self): 140 return self.context.getStudent().display_fullname 141 134 142 # Student online payments must be importable. So we might need a factory. 135 143 class StudentOnlinePaymentFactory(grok.GlobalUtility): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8702 r8703 36 36 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 37 37 from waeup.kofa.app import University 38 from waeup.kofa.payments.interfaces import IPaymentWebservice 38 39 from waeup.kofa.students.student import Student 39 40 from waeup.kofa.students.studylevel import StudentStudyLevel … … 1473 1474 self.assertEqual(self.student['payments'][value].p_level, 200) 1474 1475 1475 # Student is owner of the payment ticket. 1476 self.assertEqual(self.student['payments'][value].getOwner(), self.student) 1476 # Student is the payee of the payment ticket. 1477 self.assertEqual(IPaymentWebservice( 1478 self.student['payments'][value]).payee, 'Anna Tester') 1477 1479 1478 1480 # We simulate the approval
Note: See TracChangeset for help on using the changeset viewer.