Check for a request ctx before using the request.
Use the app json coder when blueprint json coder is set to none. Revert the failling test to using an app_context re #1710
This commit is contained in:
parent
501b8590dd
commit
4305ebdf66
2 changed files with 13 additions and 6 deletions
|
|
@ -90,12 +90,12 @@ class TestJSON(object):
|
|||
app = flask.Flask(__name__)
|
||||
|
||||
app.config['JSON_AS_ASCII'] = True
|
||||
with app.test_request_context():
|
||||
with app.app_context():
|
||||
rv = flask.json.dumps(u'\N{SNOWMAN}')
|
||||
assert rv == '"\\u2603"'
|
||||
|
||||
app.config['JSON_AS_ASCII'] = False
|
||||
with app.test_request_context():
|
||||
with app.app_context():
|
||||
rv = flask.json.dumps(u'\N{SNOWMAN}')
|
||||
assert rv == u'"\u2603"'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue