Skip to content

Modules: replace mock in themes view for real request#212

Open
fhaver-amsterdam wants to merge 2 commits into
mainfrom
modules/update-themes-view
Open

Modules: replace mock in themes view for real request#212
fhaver-amsterdam wants to merge 2 commits into
mainfrom
modules/update-themes-view

Conversation

@fhaver-amsterdam

@fhaver-amsterdam fhaver-amsterdam commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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:

  • Replace MOCK_DATA usage in MijnAmsterdamThemesView with a real HTTP request to the Mijn Amsterdam “ALL” endpoint.
  • Update tests to mock the outbound HTTP call via responses rather than relying on local mock data.
  • Simplify/adjust Mijn Amsterdam settings keys (single MIJN_AMS_ALL_PATH) and extend theme-field mappings.

Affected services

  • modules

Definition of done

  • API is backwards compatible (make openapi-diff)
  • Swagger UI up-to-date & tested (make dev)
    - [ ] Dependencies updated (make requirements)
  • Infrastructure config updated (aapp_azure_infra)
  • Loadtests for relevant endpoints (aapp_testing_loadtests)

After PR created (and deployed on dev):

  • Manual check on dev (o) e.g. use feature via Swagger or admin panel
  • Sanity check on test app (check that dev environment is selected)

Other notes

GitHub Copilot was used in writing the code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DATA usage in MijnAmsterdamThemesView with a real HTTP request to the Mijn Amsterdam “ALL” endpoint.
  • Update tests to mock the outbound HTTP call via responses rather 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).

Comment thread modules/views/theme_views.py Outdated
Comment thread modules/views/theme_views.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants