Commit Graph
3 Commits
Author SHA1 Message Date
Lucas Lefèvre bf0e340309 [FIX] web: mock active_test for search and search_read
The support for "active_test" context key has been introduced in c2918c1
However, the context key is ignored in many mocked ORM methods (if not all).

This commit adds support for the `search` and `search_read` methods.

Note: this is done to easily write some tests in odoo/enterprise#16363
and it might be usefull to test futures features (or fixes) using this
context key.

closes odoo/odoo#66393

X-original-commit: 0ad1c1631eb233b3e8f98b40f8c0813d0ad7acbe
Related: odoo/enterprise#16447
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2021-02-17 16:17:07 +00:00
Lucas Lefèvre 058ba7b907 [FIX] web: mock all name_get behaviors
The mock implementation of `name_get` does not fully reflect
the real server implementation.

The real implementation is described in tests added in
this commit.

Note: in my wildest dreams, the mock server tests would be run
against the real *and* the mock implementation to ensure they
do not diverge.

closes odoo/odoo#62430

X-original-commit: c8f59bfd5c8ddb7c7abf1108111507e667393208
Related: odoo/enterprise#15017
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2020-11-26 15:29:52 +00:00
Pierre Paridans 81d0f39480 [FIX] web, base: MockServer should have the same behavior as the server
An RPC call using an empty array of fields has not the same behavior on
the MockServer and the actual server:

- the MockServer returns only the 'id' field
- the actual server returns all the fields for the model

This is due to the fact that an empty array evaluates to a falsy value
in Python and evaluates to a thruthy value in JavaScript.

This commit restores the parity between the two.

closes odoo/odoo#36278

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-08-30 09:09:48 +00:00