Decimal value is serialized as a str value

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-03-21 10:59:58 +01:00
parent b46ae6f856
commit be168c5ada
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@
import json import json
from datetime import datetime, date from datetime import datetime, date
from decimal import Decimal
from urllib.parse import quote_plus from urllib.parse import quote_plus
from warnings import warn from warnings import warn
@ -152,6 +153,8 @@ class TestAPI(TestCase):
value = value.isoformat() value = value.isoformat()
elif isinstance(value, ImageFieldFile): elif isinstance(value, ImageFieldFile):
value = value.name value = value.name
elif isinstance(value, Decimal):
value = str(value)
query = json.dumps({field.name: value}) query = json.dumps({field.name: value})
# Create sample permission # Create sample permission