Added encoding support for decimal objects

This commit is contained in:
default-303 2021-06-19 15:18:19 +05:30
parent 7161776824
commit dfc74d22f8
3 changed files with 10 additions and 1 deletions

View file

@ -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