Ignore:
Timestamp:
3 Jul 2014, 08:17:34 (10 years ago)
Author:
Henrik Bettermann
Message:

Requirements for adding application payment tickets customized.
Applicants must upload passport picture before adding payment tickets.

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py

    r10622 r11728  
    1919"""
    2020import grok
     21from zope.component import getUtility
     22from waeup.kofa.interfaces import IExtFileStore
    2123from waeup.kofa.applicants.browser import (
    22     ApplicantRegistrationPage, ApplicantsContainerPage)
     24    ApplicantRegistrationPage, ApplicantsContainerPage,
     25    ApplicationFeePaymentAddPage)
    2326from kofacustom.nigeria.applicants.browser import (
    2427    NigeriaApplicantDisplayFormPage,
     
    113116        return
    114117
     118class CustomApplicationFeePaymentAddPage(ApplicationFeePaymentAddPage):
     119    """ Page to add an online payment ticket
     120    """
    115121
     122    @property
     123    def custom_requirements(self):
     124        store = getUtility(IExtFileStore)
     125        if not store.getFileByContext(self.context, attr=u'passport.jpg'):
     126            return _('Upload your passport photo before making payment.')
     127        return ''
     128
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py

    r11645 r11728  
    3131EXTERNAL_TESTS = False
    3232
     33SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg')
     34
    3335def external_test(func):
    3436    if not EXTERNAL_TESTS:
     
    405407        self.browser.open(self.manage_path)
    406408        #IWorkflowState(self.student).setState('started')
     409        self.applicantscontainer.application_fee = 1000.0
    407410        super(InterswitchTestsApplicants, self).fill_correct_values()
    408         self.applicantscontainer.application_fee = 1000.0
    409         self.browser.getControl(name="form.nationality").value = ['NG']
    410         self.browser.getControl(name="transition").value = ['start']
     411        self.browser.getControl("Add online").click()
     412        self.assertMatches('...Upload your passport photo before making payment...',
     413                           self.browser.contents)
     414        self.browser.open(self.manage_path)
     415        super(InterswitchTestsApplicants, self).fill_correct_values()
     416        #self.browser.getControl(name="form.nationality").value = ['NG']
     417        #self.browser.getControl(name="transition").value = ['start']
     418        image = open(SAMPLE_IMAGE, 'rb')
     419        ctrl = self.browser.getControl(name='form.passport')
     420        file_ctrl = ctrl.mech_control
     421        file_ctrl.add_file(image, filename='myphoto.jpg')
    411422        self.browser.getControl("Save").click()
    412423        self.browser.getControl("Add online").click()
Note: See TracChangeset for help on using the changeset viewer.