Files
Wiki/Odoo Module Testing.md
T

1.3 KiB

title, kind, lang, section
title kind lang section
Odoo Module Testing howto en dev

The test of Odoo modules are unit test. The module functionality must be tested in isolation of external systems.

Often it is required to mock the request and reponse of external systems.

Mocking

Here is an example of a test that mocks a _uc_download_file method.

    def _mock_uc_download_file(self, uuid):
        image_file = get_module_resource("legal_advice_fastapi", "tests/odoo.png")
        with open(image_file, "rb"