Changeset 12460 for main/ikobacustom.pcn


Ignore:
Timestamp:
13 Jan 2015, 08:18:16 (10 years ago)
Author:
Henrik Bettermann
Message:

Adjust to base package.

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  
    4949    tab_redirect = '#tab2'
    5050
     51    @property
     52    def download_filename(self):
     53        return u"%s.jpg" % self.context.document_id[:9]
     54
    5155
    5256class JPGScanEditUpload(JPGScanManageUpload):
     
    6872    download_name = u'scan.jpg'
    6973
     74    @property
     75    def download_filename(self):
     76        return u"%s.jpg" % self.context.document_id[:9]
     77
    7078
    7179class JPGScanImage(Image):
     
    7684    grok.require('waeup.viewCustomer')
    7785    download_name = u'scan.jpg'
     86
     87    @property
     88    def download_filename(self):
     89        return u"%s.jpg" % self.context.document_id[:9]
    7890
    7991class JPGScanPDFSlip(JPGScanDisplay):
     
    92104    download_name = u'scan.pdf'
    93105    tab_redirect = '#tab2'
     106
     107    @property
     108    def download_filename(self):
     109        return u"%s.pdf" % self.context.document_id[:9]
    94110
    95111
     
    112128    download_name = u'scan.pdf'
    113129
     130    @property
     131    def download_filename(self):
     132        return u"%s.pdf" % self.context.document_id[:9]
     133
    114134
    115135class PDFScanImage(Image):
     
    121141    download_name = u'scan.pdf'
    122142
     143    @property
     144    def download_filename(self):
     145        return u"%s" % self.context.document_id[:9]
     146
    123147class PDFScanSlip(PDFScanDisplay):
    124148    grok.view(PDFDocumentSlipPage)
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py

    r12401 r12460  
    307307            name='upload_pdfscanmanageupload').click()
    308308        self.assertTrue(
    309             'href="http://localhost/app/customers/K1000000/documents/%s/scan.pdf">PDF File</a>'
    310             % docid in 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)
    311311        # Browsing the link shows a real pdf
    312312        self.browser.open('scan.pdf')
    313313        self.assertEqual(
    314314            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])
    315319
    316320class ContractUITests(CustomersFullSetup):
Note: See TracChangeset for help on using the changeset viewer.