'test that error paths return no cookie'

@patch('email_marketing.signals.SailthruClient.api_post')
def test_drop_cookie_error_path(self, mock_sailthru):

    response = JsonResponse({'success': True, 'redirect_url': 'test.com/test'})
    mock_sailthru.return_value = SailthruResponse(JsonResponse({'keys': {'cookiexx': 'test_cookie'}}))
    add_email_marketing_cookies(None, response=response, user=self.user)
    self.assertFalse(('sailthru_hid' in response.cookies))
    mock_sailthru.return_value = SailthruResponse(JsonResponse({'error': 'error', 'errormsg': 'errormsg'}))
    add_email_marketing_cookies(None, response=response, user=self.user)
    self.assertFalse(('sailthru_hid' in response.cookies))
    mock_sailthru.side_effect = SailthruClientError
    add_email_marketing_cookies(None, response=response, user=self.user)
    self.assertFalse(('sailthru_hid' in response.cookies))
