You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
1.4 KiB

# Copyright 2018 Tecnativa - Ernesto tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import base
from odoo.exceptions import ValidationError
class MailMassMailingListCase(base.BaseCase):
def test_create_mass_mailing_list(self):
contact_test_1 = self.create_mailing_contact({
'name': 'Contact test 1',
'partner_id': self.partner.id,
})
contact_test_2 = self.create_mailing_contact({
'name': 'Contact test 2',
'partner_id': self.partner.id,
})
with self.assertRaises(ValidationError):
self.create_mailing_list({
'name': 'List test 3',
'contact_ids': [(6, 0, (contact_test_1 | contact_test_2).ids)]
})
def test_create_mass_mailing_list_with_subscription(self):
contact_test_1 = self.create_mailing_contact({
'name': 'Contact test 1',
'partner_id': self.partner.id,
})
contact_test_2 = self.create_mailing_contact({
'name': 'Contact test 2',
'partner_id': self.partner.id,
})
with self.assertRaises(ValidationError):
self.create_mailing_list({
'name': 'List test 3',
'subscription_contact_ids': [
(0, 0, {'contact_id': contact_test_1.id}),
(0, 0, {'contact_id': contact_test_2.id}),
]
})