-
Notifications
You must be signed in to change notification settings - Fork 30.1k
[FW][IMP] test_mail: make access tests independent from discuss models #189120
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
Conversation
@tde-banana-odoo cherrypicking of pull request #186394 failed. stdout:
Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?). In the former case, you may want to edit this PR message as well. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
6eff9be
to
7df5611
Compare
Purpose is to separate tests about content from tests about access. It eases bugfixing and improving features while keeping other tests stable through versions. Task-4320561 X-Original-Commit: odoo/odoo@030288e
Purpose is to make tests independent from channel model which has its own access rules. We now use a test model with simple rules, allowing to simulate models with * public access; * portal access; * internal access; * admin access; Tests are rewritten to be more concise and precise and use this new model. This is done in stable to keep coherency in tests codebase. It also eases writing bugfixes as tests won't have to be modified during forward port process. Finally it allows to backport improvements or fixes in later versions if it applies to previous versions. Task-4320561 X-Original-Commit: odoo/odoo@6370ca1
Use sudo when accessing opportunities messages to update. Individual access rights should not prevent from updating necessary messages when moving them and updating subject due to opportunity merge. Task-4320561 X-Original-Commit: odoo/odoo@93fbc8d
b02391e
to
283c200
Compare
@robodoo r+ rebase-merge |
Merge method set to rebase and merge, using the PR as merge commit message. |
Purpose is to make tests independent from channel model which has its own access rules. We now use a test model with simple rules, allowing to simulate models with * public access; * portal access; * internal access; * admin access; Tests are rewritten to be more concise and precise and use this new model. This is done in stable to keep coherency in tests codebase. It also eases writing bugfixes as tests won't have to be modified during forward port process. Finally it allows to backport improvements or fixes in later versions if it applies to previous versions. Task-4320561 X-original-commit: 6370ca1 Part-of: #189120 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Use sudo when accessing opportunities messages to update. Individual access rights should not prevent from updating necessary messages when moving them and updating subject due to opportunity merge. Task-4320561 X-original-commit: 93fbc8d Part-of: #189120 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Improve access related tests for mail.message and their sub models. Currently tests are dependent on discuss.channel model, and not always written in a clear way. Understanding the purpose of each test is not crystal clear. We now use a test model with simple rules, defined in test_mail addon. It allows to simulate models with * public access; * portal access; * internal access; * admin access; using ACLs and ir.rules. Tests are rewritten to be more concise and precise and use new models. This is done in stable to keep coherency in tests codebase. It also eases writing bugfixes as tests won't have to be modified during forward port process. Finally it allows to backport improvements or fixes in later versions if it applies to previous versions. Task-4320561 closes #189120 Forward-port-of: #186394 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose is to separate tests about content from tests about access. It eases bugfixing and improving features while keeping other tests stable through versions. Task-4320561 X-original-commit: odoo/odoo@030288e Part-of: odoo#189120 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose is to make tests independent from channel model which has its own access rules. We now use a test model with simple rules, allowing to simulate models with * public access; * portal access; * internal access; * admin access; Tests are rewritten to be more concise and precise and use this new model. This is done in stable to keep coherency in tests codebase. It also eases writing bugfixes as tests won't have to be modified during forward port process. Finally it allows to backport improvements or fixes in later versions if it applies to previous versions. Task-4320561 X-original-commit: odoo/odoo@6370ca1 Part-of: odoo#189120 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Use sudo when accessing opportunities messages to update. Individual access rights should not prevent from updating necessary messages when moving them and updating subject due to opportunity merge. Task-4320561 X-original-commit: odoo/odoo@93fbc8d Part-of: odoo#189120 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Improve access related tests for mail.message and their sub models. Currently tests are dependent on discuss.channel model, and not always written in a clear way. Understanding the purpose of each test is not crystal clear. We now use a test model with simple rules, defined in test_mail addon. It allows to simulate models with * public access; * portal access; * internal access; * admin access; using ACLs and ir.rules. Tests are rewritten to be more concise and precise and use new models. This is done in stable to keep coherency in tests codebase. It also eases writing bugfixes as tests won't have to be modified during forward port process. Finally it allows to backport improvements or fixes in later versions if it applies to previous versions. Task-4320561 closes #189181 Forward-port-of: #189120 Forward-port-of: #186394 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Improve access related tests for mail.message and their sub models. Currently tests are dependent on discuss.channel model, and not always written in a clear way. Understanding the purpose of each test is not crystal clear. We now use a test model with simple rules, defined in test_mail addon. It allows to simulate models with * public access; * portal access; * internal access; * admin access; using ACLs and ir.rules. Tests are rewritten to be more concise and precise and use new models. This is done in stable to keep coherency in tests codebase. It also eases writing bugfixes as tests won't have to be modified during forward port process. Finally it allows to backport improvements or fixes in later versions if it applies to previous versions. Task-4320561 closes #189202 Forward-port-of: #189120 Forward-port-of: #186394 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Command.unlink(self.env.ref('base.group_user').id), | ||
Command.link(self.env.ref('base.group_portal').id), | ||
(3, self.env.ref('base.group_user').id), | ||
(4, self.env.ref('base.group_portal').id), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello guys, just curious about why using directly the number (3 and 4) instead of the Command
is considered an improvement on this commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not ... I had conflicts, removed Command when resolving the conflict, then had an issue with Command usage and fall back on using numbers as I find it easier. But that should effectively not be done in stable, even if not really annoying in tests.
Improve access related tests for mail.message and their sub models. Currently tests are dependent on discuss.channel model, and not always written in a clear way. Understanding the purpose of each test is not crystal clear. We now use a test model with simple rules, defined in test_mail addon. It allows to simulate models with * public access; * portal access; * internal access; * admin access; using ACLs and ir.rules. Tests are rewritten to be more concise and precise and use new models. This is done in stable to keep coherency in tests codebase. It also eases writing bugfixes as tests won't have to be modified during forward port process. Finally it allows to backport improvements or fixes in later versions if it applies to previous versions. Task-4320561 closes #189181 Forward-port-of: #189120 Forward-port-of: #186394 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Improve access related tests for mail.message and their sub models. Currently
tests are dependent on discuss.channel model, and not always written in a
clear way. Understanding the purpose of each test is not crystal clear.
We now use a test model with simple rules, defined in test_mail addon. It
allows to simulate models with
using ACLs and ir.rules. Tests are rewritten to be more concise and precise
and use new models.
This is done in stable to keep coherency in tests codebase. It also eases
writing bugfixes as tests won't have to be modified during forward port
process. Finally it allows to backport improvements or fixes in later
versions if it applies to previous versions.
Task-4320561
Forward-Port-Of: #186394