From aef72c0e8aac6b1c09853c0815034635a4a465d5 Mon Sep 17 00:00:00 2001
From: Enrique Garcia <garcia@lapp.in2p3.fr>
Date: Thu, 14 Oct 2021 17:20:03 +0200
Subject: [PATCH] upload already returns record_id

---
 eossr/scripts/tests/test_scripts.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/eossr/scripts/tests/test_scripts.py b/eossr/scripts/tests/test_scripts.py
index e29b7470..37da2470 100644
--- a/eossr/scripts/tests/test_scripts.py
+++ b/eossr/scripts/tests/test_scripts.py
@@ -59,16 +59,16 @@ def test_eossr_upload_repository(tmpdir):
     path_test_filename = Path(tmpdir).joinpath('test.txt')
     Path(path_test_filename).write_text('Hello World')
     shutil.copy(Path(ROOT_DIR).joinpath('codemeta.json'), tmpdir)
-    published = eossr_upload_repository.upload(zenodo_token=os.getenv('SANDBOX_ZENODO_TOKEN'),
+    record_id = eossr_upload_repository.upload(zenodo_token=os.getenv('SANDBOX_ZENODO_TOKEN'),
                                                sandbox_flag=True,
                                                upload_directory=tmpdir,
                                                force_new_record=True
                                                )
-    record_id = published.json()['id']
+
     Path(path_test_filename).write_text('Hello World 2')
-    published = eossr_upload_repository.upload(zenodo_token=os.getenv('SANDBOX_ZENODO_TOKEN'),
-                                               sandbox_flag=True,
-                                               upload_directory=tmpdir,
-                                               record_id=record_id
-                                               )
+    eossr_upload_repository.upload(zenodo_token=os.getenv('SANDBOX_ZENODO_TOKEN'),
+                                   sandbox_flag=True,
+                                   upload_directory=tmpdir,
+                                   record_id=record_id
+                                   )
 
-- 
GitLab