- Notifications
You must be signed in to change notification settings - Fork6
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 ourterms of service andprivacy 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
base:develop
Are you sure you want to change the base?
RDI Access change for retrieving data from Kobo Reinstated#4507
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## develop #4507 +/- ##===========================================+ Coverage 84.66% 84.95% +0.29%=========================================== Files 506 506 Lines 36234 36172 -62 ===========================================+ Hits 30677 30731 +54+ Misses 5557 5441 -116
Flags with carried forward coverage won't be shown.Click here to find out more. ☔ View full report in Codecov by Sentry. |
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?
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.