-
-
Notifications
You must be signed in to change notification settings - Fork 441
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
[17.0][MIG] test_connector: Migration to 17.0 #478
[17.0][MIG] test_connector: Migration to 17.0 #478
Conversation
So we can write tests using real pieces of the framework on real models instead of using mocks which is quite limited and wring things in confusing ways. * Fix the related action implementation * Move the tests of the Default Binding in this module so we have tests that reflect the reality
We probably want to use the same env that we have in the backend_record! Besides, having 2 environments bring issues when we modify one but not the other one.
The inheritance system is copied from the Odoo on, because it works well for extending addons and because it will be easier to use for developers accustomed to it.
Tests using odoo transactions must run post install, because during the install the registry is not ready, so the components aren't neither.
It allows to open/close objects on start/end of a synchro / work session. The base method does none of that, but this is a really common use case. Example: at the beginning of the work session, I open a webservice client that is available in our WorkContext for the duration of our work. At the end, I close the client to end the connection.
When we want to test the implementation of a connector, it must be simple. Add 2 new test cases for TransactionCase and SavepointCase which load all the components of the dependencies addons on the tested addons. Only the components of the addons in state 'installed' are loaded, so we don't load components of addons that depend on the tested addon. The tests must call _init_global_registry and build_registry instead of _register_hook, so the registry is not set to ready. If the global registry is set to ready during tests, the event will trigger during the installation of addons which is not what we want. The existing test case is meant only to be used when one has to manipulate components in a custom registry. See discussion on guewen@447b22f#commitcomment-22851711
removes unknown fields from backend creation args
Currently translated at 43.7% (7 of 16 strings) Translation: connector-16.0/connector-16.0-test_connector Translate-URL: https://translation.odoo-community.org/projects/connector-16-0/connector-16-0-test_connector/it/
Currently translated at 43.7% (7 of 16 strings) Translation: connector-16.0/connector-16.0-test_connector Translate-URL: https://translation.odoo-community.org/projects/connector-16-0/connector-16-0-test_connector/sl/
Currently translated at 100.0% (16 of 16 strings) Translation: connector-16.0/connector-16.0-test_connector Translate-URL: https://translation.odoo-community.org/projects/connector-16-0/connector-16-0-test_connector/es/
7f7908a
to
0f510bb
Compare
/ocabot migration test_connector |
@nguyenminhchien the migration of test* modules make little sense out of the PR where you migrate the module. There's no way to understand if the module being migrated is failing or not until you look at all the others PRs and re-trigger their jobs. |
ok, i will merge this one with #476 |
Merged the migration of |
Depends on: