Changeset 15704


Ignore:
Timestamp:
28 Oct 2019, 07:12:20 (5 years ago)
Author:
Henrik Bettermann
Message:

Add email2 field.

Fix tests.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py

    r15696 r15704  
    9999</payment_item_detail>""" % xmldict
    100100        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
    101 
    102         self.xml_data = None
    103 
    104101        self.context.provider_amt = provider_amt
    105102        self.context.gateway_amt = GATEWAY_AMT
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py

    r15696 r15704  
    7171            '<span>40000.0</span>' in self.browser.contents)
    7272        self.payment_url = self.browser.url
    73         self.browser.getLink("CollegePAY", index=0).click()
    74         self.assertTrue('<input type="hidden" name="pay_item_id" value="0000" />' in
     73        self.browser.getLink("Pay via Interswitch", index=0).click()
     74        self.assertTrue('<input type="hidden" name="pay_item_id" value="103" />' in
    7575                           self.browser.contents)
    7676        self.assertEqual(self.student.current_mode, 'ug_ft')
     
    9292        self.student['payments']['xyz'] = acc_payment
    9393        self.browser.open(self.payments_path + '/xyz')
    94         self.browser.getLink("CollegePAY", index=0).click()
    95         self.assertMatches('...<input type="hidden" name="pay_item_id" value="0000" />...',
     94        self.browser.getLink("Pay via Interswitch", index=0).click()
     95        self.assertMatches('...<input type="hidden" name="pay_item_id" value="103" />...',
    9696                           self.browser.contents)
    9797        self.assertMatches('...Total Amount Authorized:...',
     
    104104        acc_payment.creation_date -= delta
    105105        self.browser.open(self.payments_path + '/xyz')
    106         self.browser.getLink("CollegePAY", index=0).click()
     106        self.browser.getLink("Pay via Interswitch", index=0).click()
    107107        self.assertMatches(
    108108            '...This payment ticket is too old. Please create a new ticket...',
     
    111111        acc_payment.creation_date += delta
    112112        self.browser.open(self.payments_path + '/xyz')
    113         self.browser.getLink("CollegePAY", index=0).click()
     113        self.browser.getLink("Pay via Interswitch", index=0).click()
    114114        self.assertMatches('...Total Amount Authorized:...',
    115115                           self.browser.contents)
     
    230230    def test_interswitch_form(self):
    231231        # Manager can access InterswitchForm
    232         self.browser.getLink("CollegePAY", index=0).click()
     232        self.browser.getLink("Pay via Interswitch", index=0).click()
    233233        self.assertMatches('...Total Amount Authorized:...',
    234234                           self.browser.contents)
     
    239239        self.applicant.values()[0].creation_date -= delta
    240240        self.browser.open(self.payment_url)
    241         self.browser.getLink("CollegePAY", index=0).click()
     241        self.browser.getLink("Pay via Interswitch", index=0).click()
    242242        self.assertMatches(
    243243            '...This payment ticket is too old. Please create a new ticket...',
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py

    r15696 r15704  
    3434from kofacustom.nigeria.students.browser import (
    3535    NigeriaOnlinePaymentDisplayFormPage,
     36    NigeriaStudentBaseDisplayFormPage,
    3637    NigeriaStudentBaseManageFormPage,
    3738    NigeriaStudentClearanceEditFormPage,
     
    4041    NigeriaExportPDFClearanceSlip,
    4142    NigeriaExportPDFCourseRegistrationSlip,
     43    NigeriaStudentBaseEditFormPage,
    4244    )
    4345
    4446from kofacustom.iuokada.students.interfaces import (
    4547    ICustomStudentOnlinePayment, ICustomStudentStudyCourse,
    46     ICustomStudentStudyLevel)
     48    ICustomStudentStudyLevel, ICustomStudentBase)
    4749from kofacustom.iuokada.interfaces import MessageFactory as _
     50
     51class CustomStudentBaseDisplayFormPage(NigeriaStudentBaseDisplayFormPage):
     52    """ Page to display student base data
     53    """
     54    form_fields = grok.AutoFields(ICustomStudentBase).omit(
     55        'password', 'suspended', 'suspended_comment', 'flash_notice')
     56
     57class CustomStudentBaseManageFormPage(NigeriaStudentBaseManageFormPage):
     58    """ View to manage student base data
     59    """
     60    form_fields = grok.AutoFields(ICustomStudentBase).omit(
     61        'student_id', 'adm_code', 'suspended')
     62
     63class StudentBaseEditFormPage(NigeriaStudentBaseEditFormPage):
     64    """ View to edit student base data
     65    """
     66    form_fields = grok.AutoFields(ICustomStudentBase).select(
     67        'email', 'email2', 'parents_email', 'phone',)
    4868
    4969class CustomExportPDFCourseRegistrationSlip(
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/interfaces.py

    r15563 r15704  
    1919from zope import schema
    2020from waeup.kofa.students.vocabularies import StudyLevelSource
     21from waeup.kofa.interfaces import validate_email
    2122from kofacustom.nigeria.students.interfaces import (
    2223    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
     
    3233
    3334    """
     35
     36    email2 = schema.ASCIILine(
     37        title = _(u'Second Email'),
     38        required = False,
     39        constraint=validate_email,
     40        )
     41
     42ICustomStudentBase['email2'].order = ICustomStudentBase[
     43    'phone'].order
     44ICustomStudentBase['phone'].order = ICustomStudentBase[
     45    'email'].order
    3446
    3547class ICustomStudentPersonal(INigeriaStudentPersonal):
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_export.py

    r15672 r15704  
    4848        self.assertMatches(
    4949            'adm_code,alr_date,alr_fname,alr_no,alr_results,'
    50             'clr_code,date_of_birth,def_adm,disabled,email,emp2_end,'
     50            'clr_code,date_of_birth,def_adm,disabled,email,email2,emp2_end,'
    5151            'emp2_position,emp2_reason,emp2_start,emp_end,emp_position,'
    5252            'emp_reason,emp_start,employer,employer2,'
     
    6767            'current_level,current_session\r\nmy adm code,,,,'
    6868            '"[(\'printing_craft_practice\', \'A1\')]",my clr code,1981-02-04#,,,'
    69             'anna@sample.com,,,,,,,,,,,,,Anna,,,,,,"[(\'printing_craft_practice\', \'A1\')]"'
     69            'anna@sample.com,,,,,,,,,,,,,,Anna,,,,,,"[(\'printing_craft_practice\', \'A1\')]"'
    7070            ',,,,,,,,,,,,,,,,Tester,,,234,M.,NG,,,,,,,,,,'
    7171            '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,,,123,,,,,'
Note: See TracChangeset for help on using the changeset viewer.