- Timestamp:
- 21 Dec 2015, 08:43:49 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests/test_browser.py
r13081 r13552 19 19 Test the applicant-related UI components. 20 20 """ 21 import os 21 22 from StringIO import StringIO 22 23 from datetime import datetime 23 24 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 24 25 from zope.securitypolicy.interfaces import IPrincipalRoleManager 26 from waeup.kofa.browser.tests.test_pdf import samples_dir 27 from waeup.kofa.applicants.container import ApplicantsContainer 25 28 from waeup.uniben.testing import FunctionalLayer 26 29 from waeup.uniben.configuration import CustomSessionConfiguration … … 160 163 'application/pdf') 161 164 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.