summaryrefslogtreecommitdiff
path: root/addons/test_mail/models
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2019-04-15 15:33:23 +0000
committerThibault Delavallée <tde@odoo.com>2019-04-26 10:28:09 +0000
commite87189222dfcb1c2ca3285862c9d7a28d6ea1426 (patch)
treef5943ce9a4458504f4bac0d5595db9324468413e /addons/test_mail/models
parent6aac6418fc1d0a37ae4e9165d73485f34638a3ef (diff)
[IMP] test_mail: add tests for mail gateway and perform light cleaning
This commit add some tests related to the mail gateway: more bounce management tests and some additional thread formation tests. Some test asserts about bounce / blacklist management are commented as they are not completely working currently. This will be improved in master soon. Some cleaning in also done in all mail gateway tests. Notably some call to tool methods are cleaned / simplified, duplicate tests are removed. Some low-level checks are removed. A new test model is added for mail gateway: mail.test.gateway. It is a chatter model with blacklist enabled on it. It allows to tests the various blacklist-related overrides and features as well as all basic mail gateway features. Sub-part of task 1853147 (pre-cleaning before implementing mail gateway improvements) Linked to PR #32974
Diffstat (limited to 'addons/test_mail/models')
-rw-r--r--addons/test_mail/models/test_mail_models.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/test_mail/models/test_mail_models.py b/addons/test_mail/models/test_mail_models.py
index 50de0aca07d..bdf9f164da8 100644
--- a/addons/test_mail/models/test_mail_models.py
+++ b/addons/test_mail/models/test_mail_models.py
@@ -15,6 +15,19 @@ class MailTestSimple(models.Model):
email_from = fields.Char()
+class MailTestGateway(models.Model):
+ """ A very simple model only inheriting from mail.thread to test pure mass
+ mailing features and base performances. """
+ _description = 'Simple Chatter Model for Mail Gateway'
+ _name = 'mail.test.gateway'
+ _inherit = ['mail.blacklist.mixin', 'mail.thread']
+ _primary_email = 'email_from'
+
+ name = fields.Char()
+ email_from = fields.Char()
+ custom_field = 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. """