@patch.object(forms, 'Thread')
    def test_save_confirm_is_false_threads_not_updated(self, mock_thread):
        self.assertFalse(self.banned_user.is_banned)
        # Submit the form to ban the user
        form = forms.BanUserForm(
            {'user': self.banned_user.pk, 'confirm': False})
        self.assertTrue(form.is_valid())
        form.save()

        # Make sure Thread wasn't called.
        self.assertEqual(mock_thread.objects.filter.call_count, 0)

        # Make sure that it would be called if confirm is True
        form = forms.BanUserForm(
            {
                'user': self.banned_user.pk,
                'confirm': True
            })
        self.assertTrue(form.is_valid())
        form.save()

        # Make sure Thread is called.
        self.assertEqual(mock_thread.objects.filter.call_count, 1)
Connect to searchd server, and generate keywords list for a given query.
dataset/ETHPy150Open ofa/connect/open_connect/accounts/tests/test_forms.py/BanUserFormTest.test_save_confirm_is_false_threads_not_updated--crossover with--dataset/ETHPy150Open dcramer/django-sphinx/djangosphinx/apis/api275/__init__.py/SphinxClient.BuildKeywords