-
Notifications
You must be signed in to change notification settings - Fork 10
RDI Access change for retrieving data from Kobo Reinstated #4507
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
RDI Access change for retrieving data from Kobo Reinstated #4507
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4507 +/- ##
===========================================
+ Coverage 86.49% 86.80% +0.31%
===========================================
Files 624 624
Lines 37703 37641 -62
===========================================
+ Hits 32612 32676 +64
+ Misses 5091 4965 -126
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
class TestResolveAssetsList: | ||
@pytest.fixture(autouse=True) | ||
def use_kobo_master_token(self, settings: Any) -> None: | ||
settings.KOBO_MASTER_API_TOKEN = "test-token" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this test run, on production, there is a token?
…data-from-Kobo-NEW # Conflicts: # development_tools/.env.example # src/hct_mis_api/apps/core/kobo/api.py # src/hct_mis_api/apps/core/models.py # src/hct_mis_api/apps/core/schema.py # src/hct_mis_api/config/settings.py
…data-from-Kobo-NEW
…data-from-Kobo-NEW
…trieving-data-from-Kobo-NEW' into feature/RDI-Access-change-for-retrieving-data-from-Kobo-NEW
…data-from-Kobo-NEW
AB#198299
This pull request includes several changes to the
kobo
API and related files to improve the functionality and maintainability of the codebase. The most important changes include the refactoring of theKoboAPI
class, updates to the environment configurations, and removal of deprecated code.Refactoring of
KoboAPI
class:src/hct_mis_api/apps/core/kobo/api.py
: Refactored theKoboAPI
class to simplify initialization and request handling, including the removal of theBusinessArea
dependency and the introduction of_get_request
and_get_paginated_request
methods. [1] [2] [3] [4] [5]Updates to environment configurations:
development_tools/.env.example
: AddedKOBO_PROJECT_VIEWS_ID
to the.env.example
file.src/hct_mis_api/config/env.py
: AddedKOBO_PROJECT_VIEWS_ID
to the environment configuration.src/hct_mis_api/config/settings.py
: AddedKOBO_PROJECT_VIEWS_ID
to the settings.Removal of deprecated code:
src/hct_mis_api/apps/core/kobo/common.py
: Removed thefilter_by_owner
function.src/hct_mis_api/apps/core/models.py
: Markedkobo_username
as deprecated with a TODO comment for future removal.Additional changes:
src/hct_mis_api/apps/core/schema.py
: Updatedresolve_asset
andresolve_assets_list
functions to use the refactoredKoboAPI
class and handle the newCountryCodeNotProvided
exception. [1] [2] [3] [4]tests/unit/apps/core/kobo/cassettes/TestKoboAPI.test_get_project_submissions_only_active_submissions.yaml
: Added a new test cassette for thetest_get_project_submissions_only_active_submissions
method.