Ignore:
Timestamp:
21 Dec 2015, 08:43:49 (9 years ago)
Author:
Henrik Bettermann
Message:

Customize application slip for affiliation programmes.

File:
1 edited

Legend:

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

    r13081 r13552  
    1919Test the applicant-related UI components.
    2020"""
     21import os
    2122from StringIO import StringIO
    2223from datetime import datetime
    2324from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
    2425from zope.securitypolicy.interfaces import IPrincipalRoleManager
     26from waeup.kofa.browser.tests.test_pdf import samples_dir
     27from waeup.kofa.applicants.container import ApplicantsContainer
    2528from waeup.uniben.testing import FunctionalLayer
    2629from waeup.uniben.configuration import CustomSessionConfiguration
     
    160163                         'application/pdf')
    161164        return
     165
     166    def test_asaba_application_slip(self):
     167
     168        # Remove required FieldProperty attribute first ...
     169        delattr(ApplicantsContainer, 'prefix')
     170        # ... and replace by asaba
     171        self.applicantscontainer.prefix = 'affilasa'
     172        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     173        self.slip_path = self.view_path + '/application_slip.pdf'
     174        self.browser.open(self.manage_path)
     175        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     176        self.fill_correct_values()
     177        self.browser.getControl("Save").click()
     178        IWorkflowState(self.applicant).setState('submitted')
     179        self.browser.open(self.manage_path)
     180        self.browser.getLink("Download application slip").click()
     181        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     182        self.assertEqual(self.browser.headers['Content-Type'],
     183                         'application/pdf')
     184        path = os.path.join(samples_dir(), 'application_slip.pdf')
     185        open(path, 'wb').write(self.browser.contents)
     186        print "Sample application_slip.pdf written to %s" % path
Note: See TracChangeset for help on using the changeset viewer.