Commit 369de3f
committed
[Fix]
`_get_mocked_request()` sets `registry._init_modules = set()` to simulate a minimal endpoint environment.
Since registry is the real Odoo Registry singleton, this mutation persisted after the context exited.
Odoo core `ir_http.py` uses `registry._init_modules` to build the routing map, so leaving it as set() caused post_install HttpCase tests from other modules to receive a routing map containing only server-wide modules, resulting in 404 errors on routes registered by those modules.
Fix by saving and restoring _init_modules in a try/finally block.endpoint_route_handler: Restore registry._init_modules after mocked request1 parent 2d8217b commit 369de3f
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
0 commit comments