- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for test_decimal_encoder_float (0.14 sec)
-
tests/test_jsonable_encoder.py
def test_encode_root(): class ModelWithRoot(BaseModel): __root__: str model = ModelWithRoot(__root__="Foo") assert jsonable_encoder(model) == "Foo" @needs_pydanticv2 def test_decimal_encoder_float(): data = {"value": Decimal(1.23)} assert jsonable_encoder(data) == {"value": 1.23} @needs_pydanticv2 def test_decimal_encoder_int(): data = {"value": Decimal(2)}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 21:56:59 UTC 2024 - 9K bytes - Viewed (0)