f96988cbe55d44ae29ff562ed0ed3716ef9e1304
Better tag selection ==================== The block was originally hooked onto the `external` tag under the assumption that this was the tag used to allow external requests. It's not, it's the tag for the "external" test suite, which is only one of the test suites allowed to perform external calls. Hook again onto `standard`, this might have some false positives (allow requests which we'd rather block), but it should have a lot less false negatives (block requests we want to allow). Make Overrides Easier ===================== Currently `_request_handler` raises a regular `ConnectionError`, this is an issue because it passes some requests through, which could themselves trigger genuine `ConnectionError`. When overriding `_request_handler` to implement fallbacks for bespoke URL mocks, these two cases need to be distinguishable as overrides likely want to handle blocked requests, not actual failures. Therefore `_request_handler` should a dedicated exception. This exception should be a subclass of `ConnectionError`, so that blocked requests are treated as regular connection failures by normal Odoo code. Class-scope =========== Originally `_request_handler` was scoped on the instance with the idea that it'd be a `mock` object, which individual tests could `configure_mock`. This turned out not to work correctly, because `Mock.side_effect` does not receive a `self`, hence the `Session` was inaccessible and it was not possible to passthrough local requests. While I moved to a regular `lambda` (because a direct method didn't work either), I forgot to remove the `request_mock` attribute, and didn't think that the block could now be lifted up to the class scope. Doing this, requests performed during a "standard" test case's `setUpClass` are now also blocked, which they very much should be. closes odoo/odoo#128977 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%