Added encoding support for decimal objects
This commit is contained in:
parent
7161776824
commit
dfc74d22f8
3 changed files with 10 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import datetime
|
||||
import decimal
|
||||
import io
|
||||
import uuid
|
||||
|
||||
|
|
@ -9,6 +10,11 @@ import flask
|
|||
from flask import json
|
||||
|
||||
|
||||
def test_json_encode_decimal():
|
||||
decimal_ = decimal.Decimal(100)
|
||||
assert flask.json.JSONEncoder().default(decimal_) == str(decimal_)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("debug", (True, False))
|
||||
def test_bad_request_debug_message(app, client, debug):
|
||||
app.config["DEBUG"] = debug
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue