Skip to content

Commit

Permalink
[IMP] mail: make mail gateway tests independent from gateway configur…
Browse files Browse the repository at this point in the history
…ation

Purpose of this commit is to set mail configuration (bounce and catchall
aliases as well as global domain) during mail gateway tests. That way
tests are reproducible and independent from current configuration.

PR #40442
  • Loading branch information
tde-banana-odoo committed Nov 19, 2019
1 parent 04893ed commit 320ecc3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addons/mail/tests/test_mail_gateway.py
Expand Up @@ -688,6 +688,13 @@ def setUp(self):
mail_test_model = self.env['ir.model']._get('mail.test')
mail_channel_model = self.env['ir.model']._get('mail.channel')

self.bounce_alias = 'test_bounce'
self.catchall_alias = 'test_catchall'
self.catchall_domain = 'example.com'
self.env['ir.config_parameter'].set_param('mail.bounce.alias', self.bounce_alias)
self.env['ir.config_parameter'].set_param('mail.catchall.alias', self.catchall_alias)
self.env['ir.config_parameter'].set_param('mail.catchall.domain', self.catchall_domain)

# groups@.. will cause the creation of new mail.test
self.alias = self.env['mail.alias'].create({
'alias_name': 'groups',
Expand Down

0 comments on commit 320ecc3

Please sign in to comment.