Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_return_defaults (0.32 sec)

  1. tests/test_skip_defaults.py

        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": {}}
    
    
    def test_return_exclude_unset():
        response = client.get("/exclude_unset")
        assert response.json() == {"x": None, "y": "y"}
    Registered: Sun Oct 27 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 2K bytes
    - Viewed (0)
Back to top