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.

28 lines
999 B

  1. # -*- coding: utf-8 -*-
  2. # © 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from . import base
  5. class MailMailStatisticsCase(base.BaseCase):
  6. def test_link_partner(self):
  7. partner = self.create_partner(
  8. {'name': 'Test partner'})
  9. stat = self.env['mail.mail.statistics'].create({
  10. 'model': 'res.partner',
  11. 'res_id': partner.id,
  12. })
  13. self.assertEqual(partner.id, stat.partner_id.id)
  14. def test_link_mail_contact(self):
  15. partner = self.create_partner(
  16. {'name': 'Test partner', 'email': 'test@domain.com'})
  17. contact = self.create_mailing_contact(
  18. {'partner_id': partner.id, 'list_id': self.mailing_list.id})
  19. stat = self.env['mail.mail.statistics'].create({
  20. 'model': 'mail.mass_mailing.contact',
  21. 'res_id': contact.id,
  22. })
  23. self.assertEqual(partner.id, stat.partner_id.id)