def test_post_send_error(self):
        with mock.patch('rapidsms.contrib.messaging.forms.MessageForm.send')\
                as send:
            send.side_effect = Exception()
            self.login()
            response = self.client.post(self.url, self.data)
        self.assertEqual(response.status_code, 500)
An error during sending should cause a 500 response. No guarantees
dataset/ETHPy150Open rapidsms/rapidsms/rapidsms/contrib/messaging/tests/test_views.py/TestSendView.test_post_send_error