summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/conftest.py6
-rw-r--r--tests/test_atreal_openads.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 4b030d3..691f558 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -182,7 +182,8 @@ def forwardfile_1(fake_conf, db, atreal_openads, collectivite_1):
orig_filename=os.path.basename(fake_conf['TEST_FILE_CERFA_DIA']),
content_type='application/pdf',
file_hash='ffdf456fdsvgb4bgfb6g4f5b',
- upload_file=File(open(fake_conf['TEST_FILE_CERFA_DIA'], 'rb')),
+ upload_file=File(open(fake_conf['TEST_FILE_CERFA_DIA'], 'rb'),
+ name=os.path.basename(fake_conf['TEST_FILE_CERFA_DIA'])),
upload_status='pending'
)
@@ -200,7 +201,8 @@ def forwardfile_2(fake_conf, connecteur=None, collectivite=None):
orig_filename=os.path.basename(fake_conf['TEST_FILE_CERFA_DIA']),
content_type='application/pdf',
file_hash='ffdf456fdsvgb4bgfb6g4f5b',
- upload_file=File(open(fake_conf['TEST_FILE_CERFA_DIA'], 'rb')),
+ upload_file=File(open(fake_conf['TEST_FILE_CERFA_DIA'], 'rb'),
+ name=os.path.basename(fake_conf['TEST_FILE_CERFA_DIA'])),
upload_status='pending'
)
diff --git a/tests/test_atreal_openads.py b/tests/test_atreal_openads.py
index 73fd769..e540e08 100644
--- a/tests/test_atreal_openads.py
+++ b/tests/test_atreal_openads.py
@@ -76,7 +76,7 @@ def build_forwardfile_from_path(connecteur, path, numero_dossier, type_fichier):
fwd_file.content_type = magic.from_file(path, mime=True)
with open(path, 'rb') as file_pt:
fwd_file.file_hash = get_file_digest(file_pt)
- fwd_file.upload_file = File(open(path, 'rb'))
+ fwd_file.upload_file = File(open(path, 'rb'), name=fwd_file.orig_filename)
fwd_file.upload_status = 'pending'
return fwd_file
return None