Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for test_single_form_field (0.08 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. tests/test_forms_single_param.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.post("/form/")
    def post_form(username: Annotated[str, Form()]):
        return username
    
    
    client = TestClient(app)
    
    
    def test_single_form_field():
        response = client.post("/form/", data={"username": "Rick"})
        assert response.status_code == 200, response.text
        assert response.json() == "Rick"
    
    
    def test_openapi_schema():
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 3.5K bytes
    - Click Count (0)
Back to Top