jsonify encodes decimal to str
This commit is contained in:
parent
06cf349bb8
commit
892ae95509
3 changed files with 16 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import datetime
|
||||
import decimal
|
||||
import io
|
||||
import uuid
|
||||
|
||||
|
|
@ -187,6 +188,11 @@ def test_jsonify_uuid_types(app, client):
|
|||
assert rv_uuid == test_uuid
|
||||
|
||||
|
||||
def test_json_decimal():
|
||||
rv = flask.json.dumps(decimal.Decimal("0.003"))
|
||||
assert rv == '"0.003"'
|
||||
|
||||
|
||||
def test_json_attr(app, client):
|
||||
@app.route("/add", methods=["POST"])
|
||||
def add():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue