Skip to content

[FIX] endpoint_route_handler: scope registry mutation in tests - #186

Merged
OCA-git-bot merged 1 commit into
OCA:17.0from
camptocamp:17-fix-endpoint_route_handler-test-registry-init
Oct 20, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:17.0from
camptocamp:17-fix-endpoint_route_handler-test-registry-init

Conversation

@simahawk

Copy link
Copy Markdown
Contributor

Port of #185 (18.0).

Motivation

The mocked request in endpoint_route_handler tests sets registry._init_modules to an empty set and never restores it. The registry is shared, so every routing map built afterwards loses the controllers of all modules. Tests of other modules run in the same process then get 404 on their routes.

Key changes

  • patch _init_modules only for the duration of the mocked request

The mocked request set `registry._init_modules` to an empty set and never
restored it. The registry is shared, so every routing map built afterwards
dropped the controllers of all modules: tests of other modules (eg:
`http_json_dispatcher`) got 404 on their routes when run in the same
process.

Patch it only for the duration of the mocked request.
@OCA-git-bot OCA-git-bot added mod:endpoint_route_handler Module endpoint_route_handler series:17.0 labels Oct 20, 2026
@simahawk

Copy link
Copy Markdown
Contributor Author

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 17.0-ocabot-merge-pr-186-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit aa05a4b into OCA:17.0 Oct 20, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 8f04710. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants