Ignore:
Timestamp:
9 Jul 2014, 05:43:16 (10 years ago)
Author:
Henrik Bettermann
Message:

Customize payment_slip_download_warning. Application payment tickets can be downloaded without submitting the form.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/applicants
Files:
2 edited

Legend:

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

    r11291 r11755  
    3232    NigeriaPDFApplicationSlip,
    3333    NigeriaApplicantRegistrationPage,
     34    NigeriaExportPDFPaymentSlipPage,
    3435    UG_OMIT_DISPLAY_FIELDS,
    3536    UG_OMIT_PDF_FIELDS,
     
    166167            applicant_id=applicant_id)))
    167168        return
     169
     170class CustomExportPDFPaymentSlipPage(NigeriaExportPDFPaymentSlipPage):
     171
     172    @property
     173    def payment_slip_download_warning(self):
     174        return ''
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_browser.py

    r10929 r11755  
    1919from zope.event import notify
    2020from zope.component import createObject, getUtility
     21from waeup.kofa.configuration import SessionConfiguration
    2122from waeup.aaue.testing import FunctionalLayer
    2223from waeup.kofa.applicants.tests.test_browser import (
    23     ApplicantsFullSetup, container_name_1)
     24    ApplicantsFullSetup, container_name_1, session_1)
    2425
    2526class CustomApplicantUITest(ApplicantsFullSetup):
     
    4445        self.assertTrue('<td>Password:</td>' in self.browser.contents)
    4546        return
     47
     48    def test_payment_slip_download_warning(self):
     49        configuration = SessionConfiguration()
     50        configuration.academic_session = session_1
     51        configuration.application_fee = 200.0
     52        self.app['configuration'].addSessionConfiguration(configuration)
     53        self.login()
     54        self.browser.open(self.edit_path)
     55        self.fill_correct_values()
     56        self.browser.getControl(name="form.programme_type").value = ['regular']
     57        self.browser.getControl(name="form.nationality").value = ['NG']
     58        self.browser.getControl("Save").click()
     59        self.browser.getControl("Add online payment ticket").click()
     60        self.assertMatches('...Payment ticket created...',
     61                           self.browser.contents)
     62        # Payment tickets can be downloaded without submitting the form.
     63        self.browser.getLink("Download payment slip").click()
     64        self.assertEqual(self.browser.headers['Content-Type'],
     65                 'application/pdf')
     66        return
Note: See TracChangeset for help on using the changeset viewer.