def test_notify_subscribed_accounts_endppoint_issue(
            self, update_failed_count_method):

        update_failed_count_method.return_value = None
        request_handler_return = None, client.INTERNAL_SERVER_ERROR

        with patch.object(RequestHandler, 'post',
                          return_value=request_handler_return):
            # Catch the raise
            try:
                notify_subscribed_accounts(event=None, event_data=None,
                                           secret_key=None, endpoint=None,
                                           account_id=None)
            except Exception as exc:
                self.assertEqual('Endpoint returning non HTTP 200 status. '
                                 'Actual code returned: 500', exc.args[0])
                self.assertRaises(Exception)
    def test_notify_subscribed_accounts(self, update_failed_count_method):

        account_id = '123'
        update_failed_count_method.return_value = None
        request_handler_return = None, client.OK

        with patch.object(RequestHandler, 'post',
                          return_value=request_handler_return):

            notify_subscribed_accounts(event=None, event_data=None,
                                       secret_key=None, endpoint=None,
                                       account_id=account_id)

            update_failed_count_method.assert_called_with(
                account_id,
                increment_failed_count=False
            )