+ Choose your mailing subscriptions +
++ You may also be interested in +
+
+ Your email is currently in our block list.
+
Feedback from {test_email_normalized}: {test_feedback}
') + ) + # posted messages on exclusion list record: activated, deactivated, activated again bl_record = self.env['mail.blacklist'].search([('email', '=', test_partner.email_normalized)]) self.assertEqual(len(bl_record.message_ids), 4) @@ -302,10 +312,13 @@ class TestMailingControllers(TestMailingControllersCommon): * add email to exclusion list; * remove email from exclusion list; * come back to List3; + * join List2; + * add feedback (opt-out) 'Another feedback';' * re-add email to exclusion list; """ test_mailing = self.test_mailing_on_lists.with_env(self.env) test_feedback = "My feedback" + test_feedback_2 = "Another feedback" # fetch contact and its subscription and blacklist status, to see the tour effects contact_l1 = self.mailing_list_1.contact_ids.filtered( @@ -337,23 +350,38 @@ class TestMailingControllers(TestMailingControllersCommon): self.assertFalse(subscription_l3.opt_out) self.assertFalse(subscription_l3.unsubscription_date) - # posted messages on contact record for mailing list 1: feedback, unsubscription - message_feedback = contact_l1.message_ids[0] + # posted messages on contact record for mailing list 1: last feedback, subscription update, feedback, unsubscription + message_feedback_2 = contact_l1.message_ids[0] + self.assertEqual( + message_feedback_2.body, + Markup(f'Feedback from {self.test_email_normalized}: {test_feedback_2}
') + ) + message_update = contact_l1.message_ids[1] + self.assertEqual( + message_update.body, + Markup(f'{contact_l1.display_name} subscribed to the following mailing list(s)
Feedback from {self.test_email_normalized}: {test_feedback}
') ) - message_unsub = contact_l1.message_ids[1] + message_unsub = contact_l1.message_ids[3] self.assertEqual( message_unsub.body, Markup(f'{contact_l1.display_name} unsubscribed from the following mailing list(s)
{contact_l1.display_name} subscribed to the following mailing list(s)
Feedback from {self.test_email_normalized}: {test_feedback_2}
') + ) + message_sub = contact_l3.message_ids[1] + self.assertEqual( + message_sub.body, + Markup(f'{contact_l3.display_name} subscribed to the following mailing list(s)
Choose your mailing subscriptions
-
+ Your email is currently in our block list.
+
+ Choose your mailing subscriptions +
++ You may also be interested in +
++ You are not subscribed to any of our mailing list. +
+You are not subscribed to any of our mailing list.
-You were still subscribed to those newsletters. You will not receive any news from them anymore:
-