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.

21 lines
897 B

  1. # -*- coding: utf-8 -*-
  2. # © 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from openerp.tests.common import TransactionCase
  5. from .. import exceptions
  6. class UnsubscriptionCase(TransactionCase):
  7. def test_details_required(self):
  8. """Cannot create unsubscription without details when required."""
  9. with self.assertRaises(exceptions.DetailsRequiredError):
  10. self.env["mail.unsubscription"].create({
  11. "email": "axelor@yourcompany.example.com",
  12. "mass_mailing_id": self.env.ref("mass_mailing.mass_mail_1").id,
  13. "unsubscriber_id":
  14. "res.partner,%d" % self.env.ref("base.res_partner_13").id,
  15. "reason_id":
  16. self.env.ref(
  17. "mass_mailing_custom_unsubscribe.reason_other").id,
  18. })