Ignore:
Timestamp:
17 Mar 2013, 08:40:59 (12 years ago)
Author:
Henrik Bettermann
Message:

Use better class names. The PaymentWebservice? adapter is not a webservice. KofaPaymentRequest? is not a request but a view for a simple web service.

We do not publish the data of the payee but of the payer.

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  
    2626    IStudentPaymentsContainer, IStudentNavigation, IStudentOnlinePayment)
    2727from waeup.kofa.payments import PaymentsContainer, OnlinePayment
    28 from waeup.kofa.payments.interfaces import IPaymentWebservice
     28from waeup.kofa.payments.interfaces import IPayer
    2929from waeup.kofa.utils.helpers import attrs_to_fields
    3030from waeup.kofa.accesscodes import create_accesscode
     
    142142    StudentOnlinePayment, omit=['display_item'])
    143143
    144 class PaymentWebservice(grok.Adapter):
    145     """An adapter to publish student data through a webservice.
     144class Payer(grok.Adapter):
     145    """An adapter to publish student data through a simple webservice.
    146146    """
    147147    grok.context(IStudentOnlinePayment)
    148     grok.implements(IPaymentWebservice)
     148    grok.implements(IPayer)
    149149
    150150    @property
    151151    def display_fullname(self):
    152         "Name of  payee"
     152        "Name of  payer"
    153153        return self.context.student.display_fullname
    154154
    155155    @property
    156156    def id(self):
    157         "Id of payee"
     157        "Id of payer"
    158158        return self.context.student.student_id
    159159
    160160    @property
    161161    def matric_number(self):
    162         "Matric number or reg number of payee"
     162        "Matric number or reg number of payer"
    163163        return self.context.student.matric_number
    164164
    165165    @property
    166166    def reg_number(self):
    167         "Reg number or reg number of payee"
     167        "Reg number or reg number of payer"
    168168        return self.context.student.reg_number
    169169
    170170    @property
    171171    def faculty(self):
    172         "Faculty of payee"
     172        "Faculty of payer"
    173173        return self.context.student.faccode
    174174
    175175    @property
    176176    def department(self):
    177         "Department of payee"
     177        "Department of payer"
    178178        return self.context.student.depcode
    179179
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r10016 r10030  
    3838from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
    3939from waeup.kofa.app import University
    40 from waeup.kofa.payments.interfaces import IPaymentWebservice
     40from waeup.kofa.payments.interfaces import IPayer
    4141from waeup.kofa.students.interfaces import IStudentsUtils
    4242from waeup.kofa.students.student import Student
     
    23132313        self.assertEqual(self.student['payments'][value].p_level, 200)
    23142314
    2315         # Student is the payee of 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')
    23212321
    23222322        # We simulate the approval
     
    27952795
    27962796class PublicPagesTests(StudentsFullSetup):
    2797     # Tests for swebservices
     2797    # Tests for simple webservices
    27982798
    27992799    layer = FunctionalLayer
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_payment.py

    r9533 r10030  
    2323from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
    2424from waeup.kofa.students.payments import (
    25     StudentOnlinePayment, StudentOnlinePaymentFactory, PaymentWebservice)
    26 from waeup.kofa.payments.interfaces import IOnlinePayment, IPaymentWebservice
     25    StudentOnlinePayment, StudentOnlinePaymentFactory, Payer)
     26from waeup.kofa.payments.interfaces import IOnlinePayment, IPayer
    2727from waeup.kofa.students.interfaces import IStudentNavigation
    2828
     
    4949        assert implemented_by.isOrExtends(IStudentNavigation)
    5050
    51     def test_webservice_interface(self):
    52         verify.verifyClass(IPaymentWebservice, PaymentWebservice)
     51    def test_payer_interface(self):
     52        verify.verifyClass(IPayer, Payer)
Note: See TracChangeset for help on using the changeset viewer.