def test_moderating_updates_total_messages(self):
        flag_user = self.create_user()
        superuser = self.create_superuser()
        thread_to_approve = self.create_thread()
        thread_to_approve.first_message.flag(flag_user)
        thread_to_approve.total_messages = 0
        thread_to_approve.save()
        thread_to_veto = self.create_thread()
        thread_to_veto.first_message.flag(flag_user)
        thread_to_veto.total_messages = 1
        thread_to_veto.save()

        self.assertEqual(thread_to_approve.total_messages, 0)
        self.assertEqual(thread_to_veto.total_messages, 1)

        moderate_messages(
            {'approved': [thread_to_approve.first_message.pk],
             'veto': [thread_to_veto.first_message.pk]},
            superuser
        )

        thread_to_approve = Thread.objects.get(pk=thread_to_approve.pk)
        thread_to_veto = Thread.objects.get(pk=thread_to_veto.pk)

        self.assertEqual(thread_to_approve.total_messages, 1)
        self.assertEqual(thread_to_veto.total_messages, 0)
Append the message with MIME content to the root node (as attachment)
dataset/ETHPy150Open ofa/connect/open_connect/moderation/tests/test_utils.py/TestModerationAction.test_moderating_updates_total_messages--crossover with--dataset/ETHPy150Open frappe/frappe/frappe/email/email_body.py/EMail.set_message