Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for get_exclude_unset_none (0.25 sec)

  1. tests/test_skip_defaults.py

        return ModelDefaults(x=None, y="y")
    
    
    @app.get(
        "/exclude_unset_none",
        response_model=ModelDefaults,
        response_model_exclude_unset=True,
        response_model_exclude_none=True,
    )
    def get_exclude_unset_none() -> ModelDefaults:
        return ModelDefaults(x=None, y="y")
    
    
    client = TestClient(app)
    
    
    def test_return_defaults():
        response = client.get("/")
        assert response.json() == {"sub": {}}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 2K bytes
    - Viewed (0)
Back to top