Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_multi_query (0.08 sec)

  1. tests/test_multi_query_errors.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/items/")
    def read_items(q: list[int] = Query(default=None)):
        return {"q": q}
    
    
    client = TestClient(app)
    
    
    def test_multi_query():
        response = client.get("/items/?q=5&q=6")
        assert response.status_code == 200, response.text
        assert response.json() == {"q": [5, 6]}
    
    
    def test_multi_query_incorrect():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 3.9K bytes
    - Viewed (0)
Back to top