I would like to import the mock-library in odoo testing environment. I use
import unittest.mock
but when using @mock.patch I get a NameError: name 'mock' is not defined.
What's the problem?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I would like to import the mock-library in odoo testing environment. I use
import unittest.mock
but when using @mock.patch I get a NameError: name 'mock' is not defined.
What's the problem?
yes, you can use it. unittest is part of a standard python.
I think your import statement is incorrect
use @patch
That's it! Thanks!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up