Ignore:
Timestamp:
13 Jun 2012, 13:29:35 (12 years ago)
Author:
Henrik Bettermann
Message:

Add more attributes to webservice adapter.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py

    r8703 r8708  
    8484
    8585    @property
    86     def payee(self):
     86    def display_fullname(self):
     87        "Name of  payee."
    8788        return self.context.__parent__.display_fullname
     89
     90    @property
     91    def id(self):
     92        "Id of payee"
     93        return self.context.__parent__.applicant_id
     94
     95    @property
     96    def faculty(self):
     97        "Faculty of payee"
     98        return ''
     99
     100    @property
     101    def department(self):
     102        "Department of payee"
     103        return ''
    88104
    89105# Applicant online payments must be importable. So we might need a factory.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r8703 r8708  
    732732        self.assertEqual(payment.amount_auth,200.0)
    733733        # Applicant is payee of the payment ticket.
    734         self.assertEqual(IPaymentWebservice(payment).payee, 'John Tester')
     734        self.assertEqual(
     735            IPaymentWebservice(payment).display_fullname, 'John Tester')
     736        self.assertEqual(
     737            IPaymentWebservice(payment).id, self.applicant.applicant_id)
     738        self.assertEqual(IPaymentWebservice(payment).faculty, '')
     739        self.assertEqual(IPaymentWebservice(payment).department, '')
    735740        # The pdf payment slip can't yet be opened
    736741        #self.browser.open(payment_url + '/payment_receipt.pdf')
  • main/waeup.kofa/trunk/src/waeup/kofa/payments/interfaces.py

    r8703 r8708  
    146146    """
    147147
    148     def payee():
    149         "Payments are usually paid by a payee."
     148    def display_fullname():
     149        "Name of  payee."
     150
     151    def id():
     152        "Id of payee"
     153
     154    def faculty():
     155        "Faculty of payee"
     156
     157    def department():
     158        "Department of payee"
  • main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py

    r8703 r8708  
    137137
    138138    @property
    139     def payee(self):
     139    def display_fullname(self):
     140        "Name of  payee."
    140141        return self.context.getStudent().display_fullname
     142
     143    @property
     144    def id(self):
     145        "Id of payee"
     146        return self.context.getStudent().student_id
     147
     148    @property
     149    def faculty(self):
     150        "Faculty of payee"
     151        return self.context.getStudent().faccode
     152
     153    @property
     154    def department(self):
     155        "Department of payee"
     156        return self.context.getStudent().depcode
    141157
    142158# Student online payments must be importable. So we might need a factory.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r8703 r8708  
    159159        self.certificate.school_fee_1 = 40000.0
    160160        self.certificate.school_fee_2 = 20000.0
    161         self.app['faculties']['fac1'] = Faculty()
     161        self.app['faculties']['fac1'] = Faculty(code='fac1')
    162162        self.app['faculties']['fac1']['dep1'] = Department(code='dep1')
    163163        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
     
    14751475
    14761476        # Student is the payee of the payment ticket.
    1477         self.assertEqual(IPaymentWebservice(
    1478             self.student['payments'][value]).payee, 'Anna Tester')
     1477        webservice = IPaymentWebservice(self.student['payments'][value])
     1478        self.assertEqual(webservice.display_fullname, 'Anna Tester')
     1479        self.assertEqual(webservice.id, self.student_id)
     1480        self.assertEqual(webservice.faculty, 'fac1')
     1481        self.assertEqual(webservice.department, 'dep1')
    14791482
    14801483        # We simulate the approval
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r8688 r8708  
    225225    """
    226226    grok.implements(IStudentsUtils)
    227     paymentfactory = u'waeup.StudentOnlinePayment'
    228227
    229228    def getReturningData(self, student):
     
    305304               ticket.p_session == p_session:
    306305                  return _('This type of payment has already been made.'), None
    307         payment = createObject(self.paymentfactory)
     306        payment = createObject(u'waeup.StudentOnlinePayment')
    308307        timestamp = "%d" % int(time()*1000)
    309308        payment.p_id = "p%s" % timestamp
Note: See TracChangeset for help on using the changeset viewer.