Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0] [FIX] l10n_it_fatturapa_out: Fix error tests to copy files #2303

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions l10n_it_fatturapa_out/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
* Sergio Zanchetta <https://github.com/primes2h>
* Marco Colombo <https://github.com/TheMule71>
* Giovanni Serra <giovanni@gslab.it>
* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
10 changes: 3 additions & 7 deletions l10n_it_fatturapa_out/tests/fatturapa_common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import base64
import os
import shutil
import tempfile

from lxml import etree
Expand Down Expand Up @@ -209,11 +207,9 @@ def getFilePath(self, filepath):
def getAttachment(self, name, module_name=None):
if module_name is None:
module_name = "l10n_it_fatturapa_out"
path = get_module_resource(module_name, "tests", "data", "attah_base.pdf")
currDir = os.path.dirname(path)
new_file = "{}/{}".format(currDir, name)
shutil.copyfile(path, new_file)
return self.getFilePath(new_file)
return self.getFilePath(
get_module_resource(module_name, "tests", "data", "attah_base.pdf")
)

def getFile(self, filename, module_name=None):
if module_name is None:
Expand Down