Changeset 12444 for main/waeup.ikoba/trunk/src/waeup/ikoba/documents
- Timestamp:
- 11 Jan 2015, 22:43:35 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/documents
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py
r12442 r12444 146 146 form_fields_interface = IPDFDocument 147 147 148 filenames = (' scan.pdf',)148 filenames = ('file.pdf',) 149 149 150 150 PDFDocument = attrs_to_fields(PDFDocument) -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/fileviewlets.py
r12243 r12444 40 40 title = _(u'PDF File') 41 41 mus = 1024 * 200 42 download_name = u' sample.pdf'42 download_name = u'file.pdf' 43 43 tab_redirect = '#tab2' 44 44 … … 53 53 label = _(u'PDF Scan') 54 54 title = _(u'PDF Scan') 55 download_name = u' sample.pdf'55 download_name = u'file.pdf' 56 56 57 57 … … 59 59 """Scan document. 60 60 """ 61 ##: Needs to be protected if not published 62 grok.name('sample.pdf') 61 grok.name('file.pdf') 63 62 grok.context(PDFDocument) 64 63 grok.require('waeup.Public') 65 download_name = u' sample.pdf'64 download_name = u'file.pdf' 66 65 67 66 def update(self): -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py
r12442 r12444 148 148 name='upload_pdfscanmanageupload').click() 149 149 self.assertTrue( 150 'href="http://localhost/app/documents/DOC1/ sample.pdf">PDF File</a>'150 'href="http://localhost/app/documents/DOC1/file.pdf">DOC1.pdf</a>' 151 151 in self.browser.contents) 152 152 # The file can be found in the file system 153 153 file = getUtility(IExtFileStore).getFileByContext( 154 document, attr=' sample.pdf')154 document, attr='file.pdf') 155 155 file_content = file.read() 156 156 pdf.seek(0) … … 159 159 # Browsing the link shows a real pdf only if the document 160 160 # has been published 161 self.browser.getLink(" PDF File").click()161 self.browser.getLink("DOC1.pdf").click() 162 162 self.assertTrue( 163 163 'The document requested has not yet been published' 164 164 in self.browser.contents) 165 165 IWorkflowState(document).setState(PUBLISHED) 166 self.browser.open(self.container_path + '/DOC1/ sample.pdf')166 self.browser.open(self.container_path + '/DOC1/file.pdf') 167 167 self.assertEqual( 168 168 self.browser.headers['content-type'], 'application/pdf') 169 # The name of the downloaded file will be different 170 self.assertEqual( 171 self.browser.headers['Content-Disposition'], 172 'attachment; filename="DOC1.pdf') 169 173 170 174 # Transitions can be performed … … 186 190 # File has been removed too 187 191 file = getUtility(IExtFileStore).getFileByContext( 188 document, attr=' sample.pdf')192 document, attr='file.pdf') 189 193 self.assertTrue(file is None) 190 194 … … 204 208 % document.document_id in logcontent) 205 209 self.assertTrue( 206 'INFO - zope.mgr - documents.browser.DocumentManageFormPage - %s - uploaded: sample.pdf (my_sample_scan.pdf)'210 'INFO - zope.mgr - documents.browser.DocumentManageFormPage - %s - uploaded: file.pdf (my_sample_scan.pdf)' 207 211 % document.document_id in logcontent) 208 212 self.assertTrue(
Note: See TracChangeset for help on using the changeset viewer.