From f6694aeb105c16c2a718783bb452e2bb23771e93 Mon Sep 17 00:00:00 2001 From: Anuj-Gupta4 Date: Thu, 28 Nov 2024 12:28:42 +0545 Subject: [PATCH] feat(tests): add ODK configuration file and refactor submission handling --- src/backend/tests/.pyodk_config.toml | 4 ++++ src/backend/tests/conftest.py | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100755 src/backend/tests/.pyodk_config.toml diff --git a/src/backend/tests/.pyodk_config.toml b/src/backend/tests/.pyodk_config.toml new file mode 100755 index 0000000000..5c2c5ceaad --- /dev/null +++ b/src/backend/tests/.pyodk_config.toml @@ -0,0 +1,4 @@ +[central] +base_url = "https://proxy" +username = "test@hotosm.org" +password = "Password1234" diff --git a/src/backend/tests/conftest.py b/src/backend/tests/conftest.py index bee20c3c6e..391fa1affb 100644 --- a/src/backend/tests/conftest.py +++ b/src/backend/tests/conftest.py @@ -351,18 +351,13 @@ def forms(base_url, auth, pid): """ with Client(config_path=odk_config_file) as client: - client.submissions.create( + submission_data = client.submissions.create( project_id=odk_project_id, form_id=odk_form_id, xml=submission_xml, device_id=None, encoding="utf-8", ) - submission_data = client.submissions.get( - project_id=odk_project_id, - form_id=odk_form_id, - instance_id=submission_id, - ) yield { "project": odk_project,