def test_save_first_message_sender_is_banned_user(self):
        # Make sure that everything looks right to start
        self.assertEqual(self.thread.first_message, self.message1)
        self.assertEqual(self.thread.latest_message, self.message2)
        self.assertFalse(self.banned_user.is_banned)

        # Submit the form to ban the user
        form = forms.BanUserForm({'user': self.banned_user.pk, 'confirm': True})
        self.assertTrue(form.is_valid())
        form.save()

        # Make sure the latest message hasn't changed
        thread = Thread.objects.get(pk=self.thread.pk)
        self.assertEqual(thread.latest_message, self.message2)

        # Make sure that the user is now banned
        user = User.objects.get(pk=self.banned_user.pk)
        self.assertTrue(user.is_banned)
If the first_message is sent by the banned user, just ban them.
dataset/ETHPy150Open ofa/connect/open_connect/accounts/tests/test_forms.py/BanUserFormTest.test_save_first_message_sender_is_banned_user