Changeset 15942 for main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/tests/test_browser.py
- Timestamp:
- 20 Jan 2020, 17:23:31 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/tests/test_browser.py
r15878 r15942 102 102 print "Sample application_slip.pdf written to %s" % path 103 103 104 def test_upload_ stateresult_by_manager(self):104 def test_upload_res_stat_by_manager(self): 105 105 # Add trans applicants container 106 106 self.transcontainer = ApplicantsContainer() … … 134 134 pdf_content = 'A' * 1024 * 300 # A string of 300 KB size 135 135 pseudo_pdf = StringIO(pdf_content) 136 ctrl = self.browser.getControl(name='form. stateresult')136 ctrl = self.browser.getControl(name='form.res_stat') 137 137 file_ctrl = ctrl.mech_control 138 138 file_ctrl.add_file(pseudo_pdf, filename='myform.pdf') … … 141 141 self.assertTrue('Required input is missing' in self.browser.contents) 142 142 # ... the file has been successfully uploaded 143 pdf_url = self.transapplicant_manage_path.replace('manage', ' stateresult.pdf')143 pdf_url = self.transapplicant_manage_path.replace('manage', 'res_stat.pdf') 144 144 self.browser.open(pdf_url) 145 145 self.assertEqual( … … 149 149 storage = getUtility(IExtFileStore) 150 150 file_id = IFileStoreNameChooser(self.transapplicant).chooseName( 151 attr=' stateresult.pdf')151 attr='res_stat.pdf') 152 152 # The stored file can be fetched 153 153 fd = storage.getFile(file_id) … … 156 156 # A file link is displayed on the edit view ... 157 157 self.browser.open(self.transapplicant_manage_path) 158 self.assertTrue('<a href=" stateresult.pdf">' in self.browser.contents)158 self.assertTrue('<a href="res_stat.pdf">' in self.browser.contents) 159 159 # ... and on the dislay view 160 160 self.browser.open(self.transapplicant_view_path) 161 self.assertTrue(' stateresult.pdf">Statement of Result</a>'161 self.assertTrue('res_stat.pdf">Statement of Result</a>' 162 162 in self.browser.contents) 163 163 # Adding file is properly logged … … 167 167 self.assertTrue( 168 168 'zope.mgr - kofacustom.iuokada.applicants.browser.CustomApplicantManageFormPage' 169 ' - %s - saved: stateresult'169 ' - %s - saved: res_stat' 170 170 % (self.transapplicant.applicant_id) 171 171 in logcontent)
Note: See TracChangeset for help on using the changeset viewer.