New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] Form: Add _warning attribute to check its value in tests #107272
base: 16.0
Are you sure you want to change the base?
Conversation
1b8314e
to
198e35b
Compare
wouldn't assertLogs work? |
You could also patch the onchange method to intercept the result if needed. |
Integrated helper should be great (as don't need to patch each time). But I didn't know the assertLogs(). The working command looks like this: IMHO, the logger attribute is quite tricky for normal developers. Don't you think ? |
You don't need to use So the actual code is with self.assertLogs("odoo.tests.common.onchange", level=logging.WARNING):
... which is
More tricky than a magical attribute which may or may not be present and can't be retrieved normally? |
Great! It was a proposal to enhance dev experience in test writing. Especially in this case.
We could maybe initialize the attribute as void to make it persistent and have an helper method to retrieve it. My two cents. |
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr