Modules: replace mock in themes view for real request#212
Open
fhaver-amsterdam wants to merge 2 commits into
Open
Modules: replace mock in themes view for real request#212fhaver-amsterdam wants to merge 2 commits into
fhaver-amsterdam wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the modules service’s themes endpoint to stop using test/mock payloads and instead fetch live “all services” data from Mijn Amsterdam, while updating settings and tests accordingly.
Changes:
- Replace
MOCK_DATAusage inMijnAmsterdamThemesViewwith a real HTTP request to the Mijn Amsterdam “ALL” endpoint. - Update tests to mock the outbound HTTP call via
responsesrather than relying on local mock data. - Simplify/adjust Mijn Amsterdam settings keys (single
MIJN_AMS_ALL_PATH) and extend theme-field mappings.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
modules/views/theme_views.py |
Switches the themes view from mock payload to a real upstream request; adjusts content filtering and request construction. |
modules/tests/views/test_theme_views.py |
Updates tests to stub upstream HTTP via responses and validates the upstream call count. |
modules/settings/base.py |
Replaces MIJN_AMS_API_PATHS usage with MIJN_AMS_ALL_PATH and adds header constants for outbound requests. |
modules/constants.py |
Extends the theme module → field mapping (adds mams-soil). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This PR updates the modules service’s themes endpoint to stop using test/mock payloads and instead fetch live “all services” data from Mijn Amsterdam, while updating settings and tests accordingly.
Changes:
MOCK_DATAusage inMijnAmsterdamThemesViewwith a real HTTP request to the Mijn Amsterdam “ALL” endpoint.responsesrather than relying on local mock data.MIJN_AMS_ALL_PATH) and extend theme-field mappings.Affected services
Definition of done
make openapi-diff)make dev)- [ ] Dependencies updated (make requirements)After PR created (and deployed on dev):
Other notes
GitHub Copilot was used in writing the code