eo_facture: use the filename including the digest (#85766)
gitea/barbacompta/pipeline/head This commit looks good
Details
gitea/barbacompta/pipeline/head This commit looks good
Details
This commit is contained in:
parent
bd0c07d7e7
commit
9afbd3b8c9
|
@ -590,7 +590,7 @@ class Facture(models.Model):
|
|||
|
||||
cache_filepath = None
|
||||
if hasattr(settings, 'FACTURE_DIR'):
|
||||
cache_filepath = os.path.join(settings.FACTURE_DIR, self.filename_with_client())
|
||||
cache_filepath = os.path.join(settings.FACTURE_DIR, filename)
|
||||
|
||||
if cache_filepath and os.path.exists(cache_filepath):
|
||||
with open(cache_filepath, 'rb') as fd:
|
||||
|
|
|
@ -186,8 +186,6 @@ def test_facture_filename(app, settings):
|
|||
'/view_pdf/F20190137.pdf'
|
||||
in [li.a['href'] for li in facture_0137_page.html.find_all('li') if li.text == 'Imprimer'][0]
|
||||
)
|
||||
app.get('/eo_facture/facture/%s/view_pdf/' % facture.id)
|
||||
assert os.path.exists(os.path.join(tmpdir, 'F20190137-c3f42bb0d75d379.pdf'))
|
||||
|
||||
# facture avoir proforma
|
||||
facture_avoir_page = facture_0137_page.click('Annuler')
|
||||
|
@ -197,10 +195,6 @@ def test_facture_filename(app, settings):
|
|||
'/view_pdf/Devis n°%s du 2019-10-09-AVOIR.pdf' % facture_avoir.id
|
||||
in [li.a['href'] for li in facture_avoir_page.html.find_all('li') if li.text == 'Imprimer'][0]
|
||||
)
|
||||
app.get('/eo_facture/facture/%s/view_pdf/' % facture_avoir.id)
|
||||
assert os.path.exists(
|
||||
os.path.join(tmpdir, 'Devis n°%s du 2019-10-09-c3f42bb0d75d379-AVOIR.pdf' % facture_avoir.id)
|
||||
)
|
||||
|
||||
# facture avoir
|
||||
facture_avoir_page.form.fields['proforma'][0].checked = False
|
||||
|
@ -211,8 +205,6 @@ def test_facture_filename(app, settings):
|
|||
'/view_pdf/F20190237-AVOIR.pdf'
|
||||
in [li.a['href'] for li in facture_avoir_page.html.find_all('li') if li.text == 'Imprimer'][0]
|
||||
)
|
||||
app.get('/eo_facture/facture/%s/view_pdf/' % facture_avoir.id)
|
||||
assert os.path.exists(os.path.join(tmpdir, 'F20190237-c3f42bb0d75d379-AVOIR.pdf'))
|
||||
|
||||
|
||||
def test_facture_pdf(app):
|
||||
|
|
Loading…
Reference in New Issue