def test_ajax_error_serializes_message_into_json_data():
    "ajax_error() should serialize message within json"

    got = controllers.ajax_error('something went wrong')
    assert_equals(got,
                  '{"details": null, "error": ' \
                  '"something went wrong"}')
def test_ajax_error_serializes_details_into_json_data():
    "ajax_error() should serialize details within json"

    got = controllers.ajax_error('something went wrong',
                                 'the test must not break')
    assert_equals(got,
                  '{"details": "the test must not break", ' \
                  '"error": "something went wrong"}')