Esempio n. 1
0
def test_json_error_view(patch, pyramid_request):
    handle_exception = patch("h.views.errors.handle_exception")
    exception = Mock()

    result = json_error(exception, pyramid_request)

    handle_exception.assert_called_once_with(pyramid_request, exception)
    assert result["status"] == "failure"
    assert result["reason"]
Esempio n. 2
0
def test_json_error_view(patch, pyramid_request):
    handle_exception = patch("h.views.errors.handle_exception")
    exception = Mock()

    result = json_error(exception, pyramid_request)

    handle_exception.assert_called_once_with(pyramid_request, exception)
    assert result["status"] == "failure"
    assert result["reason"]