Changeset 10030 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 17 Mar 2013, 08:40:59 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
r9984 r10030 26 26 IStudentPaymentsContainer, IStudentNavigation, IStudentOnlinePayment) 27 27 from waeup.kofa.payments import PaymentsContainer, OnlinePayment 28 from waeup.kofa.payments.interfaces import IPay mentWebservice28 from waeup.kofa.payments.interfaces import IPayer 29 29 from waeup.kofa.utils.helpers import attrs_to_fields 30 30 from waeup.kofa.accesscodes import create_accesscode … … 142 142 StudentOnlinePayment, omit=['display_item']) 143 143 144 class Pay mentWebservice(grok.Adapter):145 """An adapter to publish student data through a webservice.144 class Payer(grok.Adapter): 145 """An adapter to publish student data through a simple webservice. 146 146 """ 147 147 grok.context(IStudentOnlinePayment) 148 grok.implements(IPay mentWebservice)148 grok.implements(IPayer) 149 149 150 150 @property 151 151 def display_fullname(self): 152 "Name of paye e"152 "Name of payer" 153 153 return self.context.student.display_fullname 154 154 155 155 @property 156 156 def id(self): 157 "Id of paye e"157 "Id of payer" 158 158 return self.context.student.student_id 159 159 160 160 @property 161 161 def matric_number(self): 162 "Matric number or reg number of paye e"162 "Matric number or reg number of payer" 163 163 return self.context.student.matric_number 164 164 165 165 @property 166 166 def reg_number(self): 167 "Reg number or reg number of paye e"167 "Reg number or reg number of payer" 168 168 return self.context.student.reg_number 169 169 170 170 @property 171 171 def faculty(self): 172 "Faculty of paye e"172 "Faculty of payer" 173 173 return self.context.student.faccode 174 174 175 175 @property 176 176 def department(self): 177 "Department of paye e"177 "Department of payer" 178 178 return self.context.student.depcode 179 179 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r10016 r10030 38 38 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 39 39 from waeup.kofa.app import University 40 from waeup.kofa.payments.interfaces import IPay mentWebservice40 from waeup.kofa.payments.interfaces import IPayer 41 41 from waeup.kofa.students.interfaces import IStudentsUtils 42 42 from waeup.kofa.students.student import Student … … 2313 2313 self.assertEqual(self.student['payments'][value].p_level, 200) 2314 2314 2315 # Student is the paye eof the payment ticket.2316 webservice = IPaymentWebservice(self.student['payments'][value])2317 self.assertEqual( webservice.display_fullname, 'Anna Tester')2318 self.assertEqual( webservice.id, self.student_id)2319 self.assertEqual( webservice.faculty, 'fac1')2320 self.assertEqual( webservice.department, 'dep1')2315 # Student is the payer of the payment ticket. 2316 payer = IPayer(self.student['payments'][value]) 2317 self.assertEqual(payer.display_fullname, 'Anna Tester') 2318 self.assertEqual(payer.id, self.student_id) 2319 self.assertEqual(payer.faculty, 'fac1') 2320 self.assertEqual(payer.department, 'dep1') 2321 2321 2322 2322 # We simulate the approval … … 2795 2795 2796 2796 class PublicPagesTests(StudentsFullSetup): 2797 # Tests for s webservices2797 # Tests for simple webservices 2798 2798 2799 2799 layer = FunctionalLayer -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_payment.py
r9533 r10030 23 23 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 24 24 from waeup.kofa.students.payments import ( 25 StudentOnlinePayment, StudentOnlinePaymentFactory, Pay mentWebservice)26 from waeup.kofa.payments.interfaces import IOnlinePayment, IPay mentWebservice25 StudentOnlinePayment, StudentOnlinePaymentFactory, Payer) 26 from waeup.kofa.payments.interfaces import IOnlinePayment, IPayer 27 27 from waeup.kofa.students.interfaces import IStudentNavigation 28 28 … … 49 49 assert implemented_by.isOrExtends(IStudentNavigation) 50 50 51 def test_ webservice_interface(self):52 verify.verifyClass(IPay mentWebservice, PaymentWebservice)51 def test_payer_interface(self): 52 verify.verifyClass(IPayer, Payer)
Note: See TracChangeset for help on using the changeset viewer.