Last active
August 29, 2019 14:34
-
-
Save RaulMedeiros/cd06865c28477b90ed268e04ec8770db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import request, jsonify | |
@app.route('/jsonapi') | |
def auth(): | |
json_data = request.get_json() | |
attribute = json_data['attr'] | |
return jsonify(resp=generate_response(attribute)) | |
with app.test_client() as c: | |
rv = c.post('/jsonapi', json={ | |
'attr': 'value', 'other': 'data' | |
}) | |
json_data = rv.get_json() | |
assert generate_response(email, json_data['resp']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment