summaryrefslogtreecommitdiff
path: root/addons/mail/tests/models/test_mail_models.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2017-10-25 10:24:33 +0200
committerThibault Delavallée <tde@odoo.com>2017-11-29 10:05:01 +0100
commit2a3ac4ce22483035641e917edd60b69cd4d062e1 (patch)
tree2ea531c79393cec0f44a60867df08da49db5ffab /addons/mail/tests/models/test_mail_models.py
parent1cc1ef505828c9d89fff9c6217d477547ddc6fe8 (diff)
[MOV] mail: reorganize content of tests, separate tests from models and data
Purpose of this commit is to reorganize the mail tests. Containing * move test models into mail/tests/models/; * move data into mail/tests/data even if it is python code, as it is likely that some additional data will appear soon; * split test_mail_features into test for discuss app and test related to message post and composer, to better identify test target; * split and remove test_portal, those tests are now integrated in the other tests; There is no change in this commit. Only some renaming and file move or split. mergeup: remove / split test portal
Diffstat (limited to 'addons/mail/tests/models/test_mail_models.py')
-rw-r--r--addons/mail/tests/models/test_mail_models.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/addons/mail/tests/models/test_mail_models.py b/addons/mail/tests/models/test_mail_models.py
new file mode 100644
index 00000000000..578c779aad5
--- /dev/null
+++ b/addons/mail/tests/models/test_mail_models.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+
+class MailTestSimple(models.Model):
+ _description = 'Test Simple Chatter Record'
+ _name = 'mail.test.simple'
+ _inherit = ['mail.thread']
+
+ name = fields.Char()
+ email_from = fields.Char()
+ description = fields.Text()
+
+
+class MailTest(models.Model):
+ _description = 'Test Mail 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(MailTest, self).get_alias_values()
+ res['alias_force_thread_id'] = self.id
+ res['alias_parent_thread_id'] = self.id
+ return res