Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for test_pydanticv2 (0.24 sec)

  1. tests/test_datetime_custom_encoder.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    from .utils import needs_pydanticv1, needs_pydanticv2
    
    
    @needs_pydanticv2
    def test_pydanticv2():
        from pydantic import field_serializer
    
        class ModelWithDatetimeField(BaseModel):
            dt_field: datetime
    
            @field_serializer("dt_field")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  2. tests/test_inherited_custom_class.py

            """Spoof a missing __dict__ by raising TypeError, this is how
            asyncpg.pgroto.pgproto.UUID behaves"""
            raise TypeError("vars() argument must have __dict__ attribute")
    
    
    @needs_pydanticv2
    def test_pydanticv2():
        from pydantic import field_serializer
    
        app = FastAPI()
    
        @app.get("/fast_uuid")
        def return_fast_uuid():
            asyncpg_uuid = MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3K bytes
    - Viewed (0)
Back to top