[18.0][FIX] test_queue_job: also add an _unregister_hook function that reverts patches#875
Conversation
…rts patches Otherwise monkey-patches could be added twice when instantiating new test classes.
|
Hi @sbidoul, |
|
Is that due to a recent change or has this been there since like forever? |
|
Probably since 2021? https://github.com/OCA/queue/pull/275/files I only ran into it because I backported your change from 18.0 that adds an extra test class, thus Odoo applies the hook twice; and in 16.0 there is still a test that checks if the warning that's emitted by the patched methods is emitted only once, and it was emitted twice. But in 18.0 it wouldn't be apparent because that test was removed. |
|
/ocabot merge patch Thanks! |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at f209d61. Thanks a lot for contributing to OCA. ❤️ |
Otherwise monkey-patches could be added twice when instantiating new test classes.