Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for test_encode_custom_json_encoders_model_pydanticv2 (0.61 seconds)

  1. tests/test_jsonable_encoder.py

    
    def test_encode_unsupported():
        unserializable = Unserializable()
        with pytest.raises(ValueError):
            jsonable_encoder(unserializable)
    
    
    def test_encode_custom_json_encoders_model_pydanticv2():
        from pydantic import field_serializer
    
        class ModelWithCustomEncoder(BaseModel):
            dt_field: datetime
    
            @field_serializer("dt_field")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 9.2K bytes
    - Click Count (0)
Back to Top