Changeset 12447 for main/waeup.kofa/trunk/src/waeup/kofa/documents
- Timestamp:
- 12 Jan 2015, 09:24:58 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/documents
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/documents/fileviewlets.py
r12438 r12447 44 44 tab_redirect = '#tab2' 45 45 46 @property 47 def download_filename(self): 48 return u"%s.pdf" % self.context.document_id 49 46 50 47 51 class PDFScanDisplay(FileDisplay): … … 56 60 download_name = u'sample.pdf' 57 61 62 @property 63 def download_filename(self): 64 return u"%s.pdf" % self.context.document_id 65 58 66 59 67 class PDFScanImage(UtilityView, Image): … … 66 74 download_name = u'sample.pdf' 67 75 76 @property 77 def download_filename(self): 78 return self.context.document_id 79 68 80 def update(self): 69 81 if self.context.state != PUBLISHED: -
main/waeup.kofa/trunk/src/waeup/kofa/documents/tests/test_browser.py
r12441 r12447 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/sample.pdf">DOC1.pdf</a>' 151 151 in self.browser.contents) 152 152 # The file can be found in the file system … … 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' … … 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
Note: See TracChangeset for help on using the changeset viewer.