Changeset 12460
- Timestamp:
- 13 Jan 2015, 08:18:16 (10 years ago)
- Location:
- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/fileviewlets.py
r12403 r12460 49 49 tab_redirect = '#tab2' 50 50 51 @property 52 def download_filename(self): 53 return u"%s.jpg" % self.context.document_id[:9] 54 51 55 52 56 class JPGScanEditUpload(JPGScanManageUpload): … … 68 72 download_name = u'scan.jpg' 69 73 74 @property 75 def download_filename(self): 76 return u"%s.jpg" % self.context.document_id[:9] 77 70 78 71 79 class JPGScanImage(Image): … … 76 84 grok.require('waeup.viewCustomer') 77 85 download_name = u'scan.jpg' 86 87 @property 88 def download_filename(self): 89 return u"%s.jpg" % self.context.document_id[:9] 78 90 79 91 class JPGScanPDFSlip(JPGScanDisplay): … … 92 104 download_name = u'scan.pdf' 93 105 tab_redirect = '#tab2' 106 107 @property 108 def download_filename(self): 109 return u"%s.pdf" % self.context.document_id[:9] 94 110 95 111 … … 112 128 download_name = u'scan.pdf' 113 129 130 @property 131 def download_filename(self): 132 return u"%s.pdf" % self.context.document_id[:9] 133 114 134 115 135 class PDFScanImage(Image): … … 121 141 download_name = u'scan.pdf' 122 142 143 @property 144 def download_filename(self): 145 return u"%s" % self.context.document_id[:9] 146 123 147 class PDFScanSlip(PDFScanDisplay): 124 148 grok.view(PDFDocumentSlipPage) -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py
r12401 r12460 307 307 name='upload_pdfscanmanageupload').click() 308 308 self.assertTrue( 309 'href="http://localhost/app/customers/K1000000/documents/%s/scan.pdf"> PDF File</a>'310 % docidin self.browser.contents)309 'href="http://localhost/app/customers/K1000000/documents/%s/scan.pdf">%s.pdf</a>' 310 % (docid, docid[:9]) in self.browser.contents) 311 311 # Browsing the link shows a real pdf 312 312 self.browser.open('scan.pdf') 313 313 self.assertEqual( 314 314 self.browser.headers['content-type'], 'application/pdf') 315 # The name of the downloaded file will be different 316 self.assertEqual( 317 self.browser.headers['Content-Disposition'], 318 'attachment; filename="%s.pdf' % docid[:9]) 315 319 316 320 class ContractUITests(CustomersFullSetup):
Note: See TracChangeset for help on using the changeset viewer.