From 5b92bf33668218033369e86fb09116de50f31495 Mon Sep 17 00:00:00 2001 From: Anuj-Gupta4 Date: Thu, 28 Nov 2024 09:44:32 +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..8094eb4ed4 --- /dev/null +++ b/src/backend/tests/.pyodk_config.toml @@ -0,0 +1,4 @@ +[central] +base_url = "https://odk.dev.fmtm.hotosm.org/" +username = "odk-naxa@gmail.com" +password = "odk-central@naxa" 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,