Ignore:
Timestamp:
10 Nov 2014, 06:12:11 (10 years ago)
Author:
Henrik Bettermann
Message:

Create sample application_slip.pdf during tests.

Location:
main/kofacustom.skeleton/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.skeleton/trunk/CHANGES.txt

    r11647 r11941  
    441.2dev (unreleased)
    55===================
     6
     7* Create sample application_slip.pdf during tests.
    68
    79* Use init_update method.
  • main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/applicants/tests/test_browser.py

    r11813 r11941  
    2424from zope.catalog.interfaces import ICatalog
    2525from zope.intid.interfaces import IIntIds
     26from hurry.workflow.interfaces import IWorkflowState
    2627from kofacustom.skeleton.testing import FunctionalLayer
     28from waeup.kofa.browser.tests.test_pdf import samples_dir
    2729from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
    2830from waeup.kofa.applicants.tests.test_batching import ApplicantImportExportSetup
     
    143145        self.assertEqual(num_fail,0)
    144146        return
     147
     148class ApplicantsContainerUITests(ApplicantsFullSetup):
     149    # Tests for ApplicantsContainer class views and pages
     150
     151    layer = FunctionalLayer
     152
     153    def test_applicatio_slip(self):
     154        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     155        self.slip_path = self.view_path + '/application_slip.pdf'
     156        self.browser.open(self.manage_path)
     157        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     158        self.fill_correct_values()
     159        self.browser.getControl("Save").click()
     160        IWorkflowState(self.applicant).setState('submitted')
     161        self.browser.open(self.manage_path)
     162        self.browser.getLink("Download application slip").click()
     163        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     164        self.assertEqual(self.browser.headers['Content-Type'],
     165                         'application/pdf')
     166        path = os.path.join(samples_dir(), 'application_slip.pdf')
     167        open(path, 'wb').write(self.browser.contents)
     168        print "Sample application_slip.pdf written to %s" % path
Note: See TracChangeset for help on using the changeset viewer.