@override_settings(CELERY_EAGER_PROPAGATES_EXCEPTIONS=True, CELERY_ALWAYS_EAGER=True, BROKER_BACKEND='memory')
    def test_each_action_with_disable_notifications_for_one_librarian(self):
        librarian2_profile = self.librarian2.get_profile()
        librarian2_profile.email_notifications = False
        librarian2_profile.save()
        # remove it from expected_bcc_recipients
        self.expected_bcc_recipients.remove(librarian2_profile.user.email)

        email_count = 0
        for action in self.ACTIONS:
            # with
            expected_subject = self._make_subject(action)
            message = 'Audit Log change message goes here!'
            email_count += 1
            # when
            result = notifications.board_members_send_email_by_action(self.member, self.editor, message, action)
            # then
            self.assertTrue(result)
            self.assertEqual(len(mail.outbox), email_count)
            new_email = mail.outbox[-1]
            self.assertEqual(new_email.subject, expected_subject)
            self.assertEqual(len(self.expected_recipients), len(new_email.to))
            self.assertEqual(len(self.expected_bcc_recipients), len(new_email.bcc))
            for recipient in self.expected_recipients:
                self.assertIn(recipient, new_email.to)
            for recipient in self.expected_bcc_recipients:
                self.assertIn(recipient, new_email.bcc)
Has a value potentially if output=template.
dataset/ETHPy150Open scieloorg/scielo-manager/scielomanager/editorialmanager/tests/tests_notifications.py/BoardMembersMessageTests.test_each_action_with_disable_notifications_for_one_librarian--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/antlr3/antlr3/recognizers.py/RuleReturnScope.getTemplate