forked from orbit-oss/flask
make debugging bad key errors easier
* TRAP_BAD_REQUEST_ERRORS is enabled by default in debug mode * BadRequestKeyError has the key in the description in debug mode closes #382
This commit is contained in:
parent
fb90c310b9
commit
045dccaefb
4 changed files with 37 additions and 7 deletions
|
|
@ -44,6 +44,7 @@ class TestJSON(object):
|
|||
|
||||
def test_post_empty_json_adds_exception_to_response_content_in_debug(self, app, client):
|
||||
app.config['DEBUG'] = True
|
||||
app.config['TRAP_BAD_REQUEST_ERRORS'] = False
|
||||
|
||||
@app.route('/json', methods=['POST'])
|
||||
def post_json():
|
||||
|
|
@ -56,6 +57,7 @@ class TestJSON(object):
|
|||
|
||||
def test_post_empty_json_wont_add_exception_to_response_if_no_debug(self, app, client):
|
||||
app.config['DEBUG'] = False
|
||||
app.config['TRAP_BAD_REQUEST_ERRORS'] = False
|
||||
|
||||
@app.route('/json', methods=['POST'])
|
||||
def post_json():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue