un-deprecate request.json

This commit is contained in:
David Lord 2017-06-26 09:34:26 -07:00
parent 1172728a68
commit 5bc0d15359
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 3 additions and 34 deletions

View file

@ -1,26 +0,0 @@
# -*- coding: utf-8 -*-
"""
tests.deprecations
~~~~~~~~~~~~~~~~~~
Tests deprecation support. Not used currently.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
class TestRequestDeprecation(object):
def test_request_json(self, recwarn, app, client):
"""Request.json is deprecated"""
@app.route('/', methods=['POST'])
def index():
assert flask.request.json == {'spam': 42}
print(flask.request.json)
return 'OK'
client.post('/', data='{"spam": 42}', content_type='application/json')
recwarn.pop(DeprecationWarning)