Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for test_pydanticv1 (0.19 sec)

  1. tests/test_datetime_custom_encoder.py

        with client:
            response = client.get("/model")
        assert response.json() == {"dt_field": "2019-01-01T08:00:00+00:00"}
    
    
    # TODO: remove when deprecating Pydantic v1
    @needs_pydanticv1
    def test_pydanticv1():
        class ModelWithDatetimeField(BaseModel):
            dt_field: datetime
    
            class Config:
                json_encoders = {
                    datetime: lambda dt: dt.replace(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  2. tests/test_inherited_custom_class.py

        }
    
        assert response_pydantic.json() == {
            "a_uuid": "b8799909-f914-42de-91bc-95c819218d01"
        }
    
    
    # TODO: remove when deprecating Pydantic v1
    @needs_pydanticv1
    def test_pydanticv1():
        app = FastAPI()
    
        @app.get("/fast_uuid")
        def return_fast_uuid():
            asyncpg_uuid = MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
            assert isinstance(asyncpg_uuid, uuid.UUID)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3K bytes
    - Viewed (0)
Back to top