From d040bfde89fca1c702e6e95c3b808e0b48c2267a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 21 Nov 2017 13:34:51 +0100 Subject: [PATCH] [MOV] (test_)mail: move tests into their dedicated module Purpose: avoid having useless tables for test models in a production environment. --- addons/mail/__init__.py | 1 - addons/mail/security/ir.model.access.csv | 10 -- addons/mail/tests/__init__.py | 15 --- addons/mail/tests/models/__init__.py | 3 - addons/mail/tests/models/test_mail_models.py | 97 ------------------- addons/test_mail/__init__.py | 1 + .../tests => test_mail}/data/__init__.py | 0 .../data/test_mail_data.py | 0 addons/test_mail/models/__init__.py | 2 +- addons/test_mail/models/test_mail_models.py | 95 +++++++++++++++++- addons/test_mail/security/ir.model.access.csv | 10 ++ addons/test_mail/tests/__init__.py | 15 ++- addons/{mail => test_mail}/tests/common.py | 0 .../{mail => test_mail}/tests/test_discuss.py | 2 +- .../{mail => test_mail}/tests/test_invite.py | 2 +- .../tests/test_ir_actions.py | 0 .../tests/test_mail_activity.py | 2 +- .../tests/test_mail_channel.py | 2 +- .../tests/test_mail_followers.py | 2 +- .../tests/test_mail_gateway.py | 4 +- .../tests/test_mail_mail.py | 2 +- .../tests/test_mail_message.py | 2 +- .../tests/test_mail_template.py | 2 +- .../tests/test_message_compose.py | 6 +- .../tests/test_message_track.py | 4 +- .../tests/test_update_notification.py | 0 26 files changed, 135 insertions(+), 144 deletions(-) delete mode 100644 addons/mail/tests/__init__.py delete mode 100644 addons/mail/tests/models/__init__.py delete mode 100644 addons/mail/tests/models/test_mail_models.py rename addons/{mail/tests => test_mail}/data/__init__.py (100%) rename addons/{mail/tests => test_mail}/data/test_mail_data.py (100%) rename addons/{mail => test_mail}/tests/common.py (100%) rename addons/{mail => test_mail}/tests/test_discuss.py (98%) rename addons/{mail => test_mail}/tests/test_invite.py (96%) rename addons/{mail => test_mail}/tests/test_ir_actions.py (100%) rename addons/{mail => test_mail}/tests/test_mail_activity.py (97%) rename addons/{mail => test_mail}/tests/test_mail_channel.py (99%) rename addons/{mail => test_mail}/tests/test_mail_followers.py (99%) rename addons/{mail => test_mail}/tests/test_mail_gateway.py (99%) rename addons/{mail => test_mail}/tests/test_mail_mail.py (96%) rename addons/{mail => test_mail}/tests/test_mail_message.py (99%) rename addons/{mail => test_mail}/tests/test_mail_template.py (99%) rename addons/{mail => test_mail}/tests/test_message_compose.py (98%) rename addons/{mail => test_mail}/tests/test_message_track.py (98%) rename addons/{mail => test_mail}/tests/test_update_notification.py (100%) diff --git a/addons/mail/__init__.py b/addons/mail/__init__.py index 0aa4377b77a..f2cd96d8c83 100644 --- a/addons/mail/__init__.py +++ b/addons/mail/__init__.py @@ -3,4 +3,3 @@ from . import models from . import wizard from . import controllers -from .tests import models diff --git a/addons/mail/security/ir.model.access.csv b/addons/mail/security/ir.model.access.csv index c0ef5639d28..7563d8b182d 100644 --- a/addons/mail/security/ir.model.access.csv +++ b/addons/mail/security/ir.model.access.csv @@ -33,16 +33,6 @@ access_mail_template,mail.template,model_mail_template,base.group_user,1,1,1,0 access_mail_template_system,mail.template_system,model_mail_template,base.group_system,1,1,1,1 access_mail_shortcode,mail.shortcode,model_mail_shortcode,base.group_user,1,1,1,1 access_mail_shortcode_portal,mail.shortcode.portal,model_mail_shortcode,base.group_portal,1,0,0,0 -access_mail_test_simple_portal,mail.test.simple.portal,model_mail_test_simple,base.group_portal,1,0,0,0 -access_mail_test_simple_user,mail.test.simple.user,model_mail_test_simple,base.group_user,1,1,1,1 -access_mail_test_track_portal,mail.test.track.portal,model_mail_test_track,base.group_portal,0,0,0,0 -access_mail_test_track_user,mail.test.track.user.employee,model_mail_test_track,base.group_user,1,1,1,1 -access_mail_test_activity_portal,mail.test.activity.portal,model_mail_test_activity,base.group_portal,1,0,0,0 -access_mail_test_activity_user,mail.test.activity.user,model_mail_test_activity,base.group_user,1,1,1,1 -access_mail_test_full_portal,mail.test.full.portal,model_mail_test_full,base.group_portal,0,0,0,0 -access_mail_test_full_user,mail.test.full.user,model_mail_test_full,base.group_user,1,1,1,1 -access_mail_test_portal,mail.test.portal,model_mail_test,base.group_portal,1,1,0,0 -access_mail_test_user,mail.test.user,model_mail_test,base.group_user,1,1,1,1 access_mail_activity_all,mail.activity.all,model_mail_activity,,0,0,0,0 access_mail_activity_user,mail.activity.user,model_mail_activity,base.group_user,1,1,1,1 access_mail_activity_type_all,mail.activity.type.all,model_mail_activity_type,,0,0,0,0 diff --git a/addons/mail/tests/__init__.py b/addons/mail/tests/__init__.py deleted file mode 100644 index bf46d383f92..00000000000 --- a/addons/mail/tests/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import test_mail_activity -from . import test_mail_followers -from . import test_mail_message -from . import test_mail_mail -from . import test_mail_channel -from . import test_mail_gateway -from . import test_mail_template -from . import test_message_compose -from . import test_message_track -from . import test_invite -from . import test_ir_actions -from . import test_update_notification -from . import test_discuss diff --git a/addons/mail/tests/models/__init__.py b/addons/mail/tests/models/__init__.py deleted file mode 100644 index 420d064776c..00000000000 --- a/addons/mail/tests/models/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import test_mail_models \ No newline at end of file diff --git a/addons/mail/tests/models/test_mail_models.py b/addons/mail/tests/models/test_mail_models.py deleted file mode 100644 index a45602bf6d5..00000000000 --- a/addons/mail/tests/models/test_mail_models.py +++ /dev/null @@ -1,97 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import fields, models - - -class MailTestSimple(models.Model): - """ A very simple model only inheriting from mail.thread when only - communication history is necessary. """ - _description = 'Simple Chatter Model' - _name = 'mail.test.simple' - _inherit = ['mail.thread'] - - name = fields.Char() - email_from = fields.Char() - - -class MailTestStandard(models.Model): - """ This model can be used in tests when automatic subscription and simple - tracking is necessary. Most features are present in a simple way. """ - _description = 'Standard Chatter Model' - _name = 'mail.test.track' - _inherit = ['mail.thread'] - - name = fields.Char() - email_from = fields.Char() - user_id = fields.Many2one('res.users', 'Responsible', track_visibility='onchange') - umbrella_id = fields.Many2one('mail.test', track_visibility='onchange') - - -class MailTestActivity(models.Model): - """ This model can be used to test activities in addition to simple chatter - features. """ - _description = 'Activity Model' - _name = 'mail.test.activity' - _inherit = ['mail.thread', 'mail.activity.mixin'] - - name = fields.Char() - email_from = fields.Char() - - -class MailTestFull(models.Model): - """ This model can be used in tests when complex chatter features are - required like modeling tasks or tickets. """ - _description = 'Full Chatter Model' - _name = 'mail.test.full' - _inherit = ['mail.thread'] - - name = fields.Char() - email_from = fields.Char(track_visibility='always') - count = fields.Integer(default=1) - datetime = fields.Datetime(default=fields.Datetime.now) - mail_template = fields.Many2one('mail.template', 'Template') - customer_id = fields.Many2one('res.partner', 'Customer', track_visibility='onchange') - user_id = fields.Many2one('res.users', 'Responsible', track_visibility='onchange') - umbrella_id = fields.Many2one('mail.test', track_visibility='onchange') - - def _track_template(self, tracking): - res = super(MailTestFull, self)._track_template(tracking) - record = self[0] - changes, tracking_value_ids = tracking[record.id] - if 'customer_id' in changes and record.mail_template: - res['customer_id'] = (record.mail_template, {'composition_mode': 'mass_mail'}) - elif 'datetime' in changes: - res['datetime'] = ('mail.track_template', {'composition_mode': 'mass_mail'}) - return res - - def _track_subtype(self, init_values): - self.ensure_one() - if 'umbrella_id' in init_values and self.umbrella_id: - return 'mail.track_subtype_umbrella' - return super(MailTestFull, self)._track_subtype(init_values) - - -class MailTestAlias(models.Model): - """ This model can be used in tests when umbrella records like projects - or teams are required. """ - _description = 'Alias Chatter Model' - _name = 'mail.test' - _mail_post_access = 'read' - _inherit = ['mail.thread', 'mail.alias.mixin'] - - name = fields.Char() - description = fields.Text() - alias_id = fields.Many2one( - 'mail.alias', 'Alias', - delegate=True) - - def get_alias_model_name(self, vals): - return vals.get('alias_model', 'mail.test') - - def get_alias_values(self): - self.ensure_one() - res = super(MailTestAlias, self).get_alias_values() - res['alias_force_thread_id'] = self.id - res['alias_parent_thread_id'] = self.id - return res diff --git a/addons/test_mail/__init__.py b/addons/test_mail/__init__.py index cde864bae21..c36df4aa451 100644 --- a/addons/test_mail/__init__.py +++ b/addons/test_mail/__init__.py @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- +from . import data from . import models diff --git a/addons/mail/tests/data/__init__.py b/addons/test_mail/data/__init__.py similarity index 100% rename from addons/mail/tests/data/__init__.py rename to addons/test_mail/data/__init__.py diff --git a/addons/mail/tests/data/test_mail_data.py b/addons/test_mail/data/test_mail_data.py similarity index 100% rename from addons/mail/tests/data/test_mail_data.py rename to addons/test_mail/data/test_mail_data.py diff --git a/addons/test_mail/models/__init__.py b/addons/test_mail/models/__init__.py index 26ed2919633..420d064776c 100644 --- a/addons/test_mail/models/__init__.py +++ b/addons/test_mail/models/__init__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -from . import test_mail_models +from . import test_mail_models \ No newline at end of file diff --git a/addons/test_mail/models/test_mail_models.py b/addons/test_mail/models/test_mail_models.py index 509b3a67d31..ec3e712fe38 100644 --- a/addons/test_mail/models/test_mail_models.py +++ b/addons/test_mail/models/test_mail_models.py @@ -1,7 +1,100 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import models, fields, api +from odoo import api, fields, models + + +class MailTestSimple(models.Model): + """ A very simple model only inheriting from mail.thread when only + communication history is necessary. """ + _description = 'Simple Chatter Model' + _name = 'mail.test.simple' + _inherit = ['mail.thread'] + + name = fields.Char() + email_from = fields.Char() + + +class MailTestStandard(models.Model): + """ This model can be used in tests when automatic subscription and simple + tracking is necessary. Most features are present in a simple way. """ + _description = 'Standard Chatter Model' + _name = 'mail.test.track' + _inherit = ['mail.thread'] + + name = fields.Char() + email_from = fields.Char() + user_id = fields.Many2one('res.users', 'Responsible', track_visibility='onchange') + umbrella_id = fields.Many2one('mail.test', track_visibility='onchange') + + +class MailTestActivity(models.Model): + """ This model can be used to test activities in addition to simple chatter + features. """ + _description = 'Activity Model' + _name = 'mail.test.activity' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + name = fields.Char() + email_from = fields.Char() + + +class MailTestFull(models.Model): + """ This model can be used in tests when complex chatter features are + required like modeling tasks or tickets. """ + _description = 'Full Chatter Model' + _name = 'mail.test.full' + _inherit = ['mail.thread'] + + name = fields.Char() + email_from = fields.Char(track_visibility='always') + count = fields.Integer(default=1) + datetime = fields.Datetime(default=fields.Datetime.now) + mail_template = fields.Many2one('mail.template', 'Template') + customer_id = fields.Many2one('res.partner', 'Customer', track_visibility='onchange') + user_id = fields.Many2one('res.users', 'Responsible', track_visibility='onchange') + umbrella_id = fields.Many2one('mail.test', track_visibility='onchange') + + def _track_template(self, tracking): + res = super(MailTestFull, self)._track_template(tracking) + record = self[0] + changes, tracking_value_ids = tracking[record.id] + if 'customer_id' in changes and record.mail_template: + res['customer_id'] = (record.mail_template, {'composition_mode': 'mass_mail'}) + elif 'datetime' in changes: + res['datetime'] = ('mail.track_template', {'composition_mode': 'mass_mail'}) + return res + + def _track_subtype(self, init_values): + self.ensure_one() + if 'umbrella_id' in init_values and self.umbrella_id: + return 'mail.track_subtype_umbrella' + return super(MailTestFull, self)._track_subtype(init_values) + + +class MailTestAlias(models.Model): + """ This model can be used in tests when umbrella records like projects + or teams are required. """ + _description = 'Alias Chatter Model' + _name = 'mail.test' + _mail_post_access = 'read' + _inherit = ['mail.thread', 'mail.alias.mixin'] + + name = fields.Char() + description = fields.Text() + alias_id = fields.Many2one( + 'mail.alias', 'Alias', + delegate=True) + + def get_alias_model_name(self, vals): + return vals.get('alias_model', 'mail.test') + + def get_alias_values(self): + self.ensure_one() + res = super(MailTestAlias, self).get_alias_values() + res['alias_force_thread_id'] = self.id + res['alias_parent_thread_id'] = self.id + return res class MailModel(models.Model): diff --git a/addons/test_mail/security/ir.model.access.csv b/addons/test_mail/security/ir.model.access.csv index 20434d77031..58902f6235f 100644 --- a/addons/test_mail/security/ir.model.access.csv +++ b/addons/test_mail/security/ir.model.access.csv @@ -1,2 +1,12 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_test_performance_mail,access_test_performance_mail,model_test_performance_mail,,1,1,1,1 +access_mail_test_simple_portal,mail.test.simple.portal,model_mail_test_simple,base.group_portal,1,0,0,0 +access_mail_test_simple_user,mail.test.simple.user,model_mail_test_simple,base.group_user,1,1,1,1 +access_mail_test_track_portal,mail.test.track.portal,model_mail_test_track,base.group_portal,0,0,0,0 +access_mail_test_track_user,mail.test.track.user.employee,model_mail_test_track,base.group_user,1,1,1,1 +access_mail_test_activity_portal,mail.test.activity.portal,model_mail_test_activity,base.group_portal,1,0,0,0 +access_mail_test_activity_user,mail.test.activity.user,model_mail_test_activity,base.group_user,1,1,1,1 +access_mail_test_full_portal,mail.test.full.portal,model_mail_test_full,base.group_portal,0,0,0,0 +access_mail_test_full_user,mail.test.full.user,model_mail_test_full,base.group_user,1,1,1,1 +access_mail_test_portal,mail.test.portal,model_mail_test,base.group_portal,1,1,0,0 +access_mail_test_user,mail.test.user,model_mail_test,base.group_user,1,1,1,1 diff --git a/addons/test_mail/tests/__init__.py b/addons/test_mail/tests/__init__.py index 6c372385ce5..dc9978773c4 100644 --- a/addons/test_mail/tests/__init__.py +++ b/addons/test_mail/tests/__init__.py @@ -1,3 +1,16 @@ # -*- coding: utf-8 -*- -from . import test_performance +from . import test_mail_activity +from . import test_mail_followers +from . import test_mail_message +from . import test_mail_mail +from . import test_mail_channel +from . import test_mail_gateway +from . import test_mail_template +from . import test_message_compose +from . import test_message_track +from . import test_invite +from . import test_ir_actions +from . import test_update_notification +from . import test_discuss +from . import test_performance \ No newline at end of file diff --git a/addons/mail/tests/common.py b/addons/test_mail/tests/common.py similarity index 100% rename from addons/mail/tests/common.py rename to addons/test_mail/tests/common.py diff --git a/addons/mail/tests/test_discuss.py b/addons/test_mail/tests/test_discuss.py similarity index 98% rename from addons/mail/tests/test_discuss.py rename to addons/test_mail/tests/test_discuss.py index ea155bf3232..3a3cb21d043 100644 --- a/addons/mail/tests/test_discuss.py +++ b/addons/test_mail/tests/test_discuss.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo.addons.mail.tests.common import BaseFunctionalTest, TestRecipients, MockEmails +from odoo.addons.test_mail.tests.common import BaseFunctionalTest, TestRecipients, MockEmails class TestChatterTweaks(BaseFunctionalTest, TestRecipients): diff --git a/addons/mail/tests/test_invite.py b/addons/test_mail/tests/test_invite.py similarity index 96% rename from addons/mail/tests/test_invite.py rename to addons/test_mail/tests/test_invite.py index bb50b3f1dc9..4defaf1578b 100644 --- a/addons/mail/tests/test_invite.py +++ b/addons/test_mail/tests/test_invite.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo.addons.mail.tests import common +from odoo.addons.test_mail.tests import common from odoo.tools import mute_logger diff --git a/addons/mail/tests/test_ir_actions.py b/addons/test_mail/tests/test_ir_actions.py similarity index 100% rename from addons/mail/tests/test_ir_actions.py rename to addons/test_mail/tests/test_ir_actions.py diff --git a/addons/mail/tests/test_mail_activity.py b/addons/test_mail/tests/test_mail_activity.py similarity index 97% rename from addons/mail/tests/test_mail_activity.py rename to addons/test_mail/tests/test_mail_activity.py index 637bd05c021..2d21649b01b 100644 --- a/addons/mail/tests/test_mail_activity.py +++ b/addons/test_mail/tests/test_mail_activity.py @@ -5,7 +5,7 @@ from datetime import date from dateutil.relativedelta import relativedelta from odoo import exceptions -from odoo.addons.mail.tests.common import BaseFunctionalTest +from odoo.addons.test_mail.tests.common import BaseFunctionalTest from odoo.tools import mute_logger diff --git a/addons/mail/tests/test_mail_channel.py b/addons/test_mail/tests/test_mail_channel.py similarity index 99% rename from addons/mail/tests/test_mail_channel.py rename to addons/test_mail/tests/test_mail_channel.py index e06b10eeaa8..03c9ed07a53 100644 --- a/addons/mail/tests/test_mail_channel.py +++ b/addons/test_mail/tests/test_mail_channel.py @@ -2,7 +2,7 @@ from email.utils import formataddr -from odoo.addons.mail.tests import common +from odoo.addons.test_mail.tests import common from odoo.exceptions import AccessError, except_orm from odoo.tools import mute_logger diff --git a/addons/mail/tests/test_mail_followers.py b/addons/test_mail/tests/test_mail_followers.py similarity index 99% rename from addons/mail/tests/test_mail_followers.py rename to addons/test_mail/tests/test_mail_followers.py index 887f9140c2b..9e3c55ee0a9 100644 --- a/addons/mail/tests/test_mail_followers.py +++ b/addons/test_mail/tests/test_mail_followers.py @@ -3,7 +3,7 @@ from psycopg2 import IntegrityError -from odoo.addons.mail.tests import common +from odoo.addons.test_mail.tests import common from odoo.tools.misc import mute_logger diff --git a/addons/mail/tests/test_mail_gateway.py b/addons/test_mail/tests/test_mail_gateway.py similarity index 99% rename from addons/mail/tests/test_mail_gateway.py rename to addons/test_mail/tests/test_mail_gateway.py index 575972d4adf..b082733b3fc 100644 --- a/addons/mail/tests/test_mail_gateway.py +++ b/addons/test_mail/tests/test_mail_gateway.py @@ -5,8 +5,8 @@ import socket from email.utils import formataddr -from odoo.addons.mail.tests.data.test_mail_data import MAIL_TEMPLATE, MAIL_TEMPLATE_PLAINTEXT, MAIL_MULTIPART_MIXED, MAIL_MULTIPART_MIXED_TWO, MAIL_MULTIPART_IMAGE -from odoo.addons.mail.tests.common import BaseFunctionalTest, MockEmails +from odoo.addons.test_mail.data.test_mail_data import MAIL_TEMPLATE, MAIL_TEMPLATE_PLAINTEXT, MAIL_MULTIPART_MIXED, MAIL_MULTIPART_MIXED_TWO, MAIL_MULTIPART_IMAGE +from odoo.addons.test_mail.tests.common import BaseFunctionalTest, MockEmails from odoo.tools import mute_logger diff --git a/addons/mail/tests/test_mail_mail.py b/addons/test_mail/tests/test_mail_mail.py similarity index 96% rename from addons/mail/tests/test_mail_mail.py rename to addons/test_mail/tests/test_mail_mail.py index 862178c0c7c..eeeb22a296f 100644 --- a/addons/mail/tests/test_mail_mail.py +++ b/addons/test_mail/tests/test_mail_mail.py @@ -3,7 +3,7 @@ import itertools -from odoo.addons.mail.tests import common as mail_common +from odoo.addons.test_mail.tests import common as mail_common from odoo.tests import common from odoo.tools import mute_logger diff --git a/addons/mail/tests/test_mail_message.py b/addons/test_mail/tests/test_mail_message.py similarity index 99% rename from addons/mail/tests/test_mail_message.py rename to addons/test_mail/tests/test_mail_message.py index 779b8d4f526..1fe8924dda6 100644 --- a/addons/mail/tests/test_mail_message.py +++ b/addons/test_mail/tests/test_mail_message.py @@ -2,7 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 -from odoo.addons.mail.tests import common +from odoo.addons.test_mail.tests import common from odoo.exceptions import AccessError, except_orm from odoo.tools import mute_logger diff --git a/addons/mail/tests/test_mail_template.py b/addons/test_mail/tests/test_mail_template.py similarity index 99% rename from addons/mail/tests/test_mail_template.py rename to addons/test_mail/tests/test_mail_template.py index 5705ac3ad4e..388e669b730 100644 --- a/addons/mail/tests/test_mail_template.py +++ b/addons/test_mail/tests/test_mail_template.py @@ -4,7 +4,7 @@ import base64 from datetime import datetime, timedelta -from odoo.addons.mail.tests.common import BaseFunctionalTest, MockEmails, TestRecipients +from odoo.addons.test_mail.tests.common import BaseFunctionalTest, MockEmails, TestRecipients from odoo.tools import mute_logger, DEFAULT_SERVER_DATETIME_FORMAT diff --git a/addons/mail/tests/test_message_compose.py b/addons/test_mail/tests/test_message_compose.py similarity index 98% rename from addons/mail/tests/test_message_compose.py rename to addons/test_mail/tests/test_message_compose.py index 043f458e33f..6c561bab89d 100644 --- a/addons/mail/tests/test_message_compose.py +++ b/addons/test_mail/tests/test_message_compose.py @@ -5,9 +5,9 @@ import base64 from unittest.mock import patch -from odoo.addons.mail.tests.common import BaseFunctionalTest, MockEmails, TestRecipients -from odoo.addons.mail.tests.data.test_mail_data import MAIL_TEMPLATE_PLAINTEXT -from odoo.addons.mail.tests.models.test_mail_models import MailTestSimple +from odoo.addons.test_mail.tests.common import BaseFunctionalTest, MockEmails, TestRecipients +from odoo.addons.test_mail.data.test_mail_data import MAIL_TEMPLATE_PLAINTEXT +from odoo.addons.test_mail.models.test_mail_models import MailTestSimple from odoo.exceptions import AccessError from odoo.tools import mute_logger diff --git a/addons/mail/tests/test_message_track.py b/addons/test_mail/tests/test_message_track.py similarity index 98% rename from addons/mail/tests/test_message_track.py rename to addons/test_mail/tests/test_message_track.py index abb7bdf0fae..e66286fd406 100644 --- a/addons/mail/tests/test_message_track.py +++ b/addons/test_mail/tests/test_message_track.py @@ -2,7 +2,7 @@ from email.utils import formataddr -from odoo.addons.mail.tests import common +from odoo.addons.test_mail.tests import common class TestTracking(common.BaseFunctionalTest, common.MockEmails): @@ -105,7 +105,7 @@ class TestTracking(common.BaseFunctionalTest, common.MockEmails): def test_message_track_template(self): """ Update some tracked fields linked to some template -> message with onchange + always tracked values """ mail_template = self.env['mail.template'].create({ - 'model_id': self.env.ref('mail.model_mail_test_full').id, + 'model_id': self.env.ref('test_mail.model_mail_test_full').id, 'body_html': '

Hello ${object.name}

', 'subject': 'Test Template', 'partner_to': '${object.customer_id.id | safe}', diff --git a/addons/mail/tests/test_update_notification.py b/addons/test_mail/tests/test_update_notification.py similarity index 100% rename from addons/mail/tests/test_update_notification.py rename to addons/test_mail/tests/test_update_notification.py