diff options
| author | Aaron Bohy <aab@odoo.com> | 2021-03-15 12:38:11 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2021-03-15 15:06:30 +0000 |
| commit | 9d9f4dea26f3203dd93aefe734ab86503260e219 (patch) | |
| tree | caeb6b72889a951549346fe42db30df59c875772 /addons/web/static/src/xml/file_upload_progress_bar.xml | |
| parent | 995ba0c2033455a2092439e9728b3f731381c742 (diff) | |
[FIX] hr_attendance: correctly unpatch session at end of test
The 'addMockEnvironment' test utils allows to patch a lot of stuff,
including the session, for the sake of a test. However, it assumes
that it is only called once inside a test (or at least, that its
cleanUp function is always called before it is called again).
In this hr_attendance test, it isn't the case. 2 client actions are
instantiated, and addMockEnvironment is called for each of them,
in particular to patch the session.
The first call stores the current session (the real one), to restore
it in its cleanup (1). The second call stores the current session
(the mocked one, produced by the first call), to restore it in its
cleanup (2). The cleanup functions are called in order, so (1)
before (2), meaning that at the end, we end up with the session
being the mocked one of the first call to addMockEnvironment.
The very short term solution is to ensure, in this test, that the
cleanup functions are called in the correct order. For the long
term, we are working on a robust mechanism to correctly clean up
everything after a test.
Issue spotted in the assets revamp task, which mixed a bit the
order of the tests.
closes odoo/odoo#67874
X-original-commit: bb43c74dd10c76b8a80d5749106b86432b13909e
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/xml/file_upload_progress_bar.xml')
0 files changed, 0 insertions, 0 deletions
