Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for gorm (0.01 sec)

  1. tests/test_forms_single_model.py

    
    @app.post("/form/")
    def post_form(user: Annotated[FormModel, Form()]):
        return user
    
    
    @app.post("/form-extra-allow/")
    def post_form_extra_allow(params: Annotated[FormModelExtraAllow, Form()]):
        return params
    
    
    client = TestClient(app)
    
    
    def test_send_all_data():
        response = client.post(
            "/form/",
            data={
                "username": "Rick",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 3.4K bytes
    - Viewed (0)
  2. tests/test_tuples.py

    def test_tuple_form_valid():
        response = client.post("/tuple-form/", data={"values": ("1", "2")})
        assert response.status_code == 200, response.text
        assert response.json() == [1, 2]
    
    
    def test_tuple_form_invalid():
        response = client.post("/tuple-form/", data={"values": ("1", "2", "3")})
        assert response.status_code == 422, response.text
    
        response = client.post("/tuple-form/", data={"values": ("1")})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.8K bytes
    - Viewed (0)
  3. tests/test_request_params/test_form/test_optional_str.py

        return {"p": p}
    
    
    class FormModelOptionalStr(BaseModel):
        p: Optional[str] = None
    
    
    @app.post("/model-optional-str", operation_id="model_optional_str")
    async def read_model_optional_str(p: Annotated[FormModelOptionalStr, Form()]):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/optional-str", "/model-optional-str"],
    )
    def test_optional_str_schema(path: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  4. tests/test_request_params/test_form/test_required_str.py

        return {"p": p}
    
    
    class FormModelRequiredStr(BaseModel):
        p: str
    
    
    @app.post("/model-required-str", operation_id="model_required_str")
    async def read_model_required_str(p: Annotated[FormModelRequiredStr, Form()]):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/required-str", "/model-required-str"],
    )
    def test_required_str_schema(path: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  5. tests/test_request_params/test_form/test_optional_list.py

    ):
        return {"p": p}
    
    
    class FormModelOptionalListStr(BaseModel):
        p: Optional[list[str]] = None
    
    
    @app.post("/model-optional-list-str", operation_id="model_optional_list_str")
    async def read_model_optional_list_str(p: Annotated[FormModelOptionalListStr, Form()]):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
        "path",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  6. tests/test_request_params/test_form/test_list.py

    async def read_required_list_str(p: Annotated[list[str], Form()]):
        return {"p": p}
    
    
    class FormModelRequiredListStr(BaseModel):
        p: list[str]
    
    
    @app.post("/model-required-list-str", operation_id="model_required_list_str")
    def read_model_required_list_str(p: Annotated[FormModelRequiredListStr, Form()]):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/required-list-str", "/model-required-list-str"],
    )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11.7K bytes
    - Viewed (0)
  7. tests/test_regex_deprecated_body.py

    import pytest
    from fastapi import FastAPI, Form
    from fastapi.exceptions import FastAPIDeprecationWarning
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    from .utils import needs_py310
    
    
    def get_client():
        app = FastAPI()
        with pytest.warns(FastAPIDeprecationWarning):
    
            @app.post("/items/")
            async def read_items(
                q: Annotated[str | None, Form(regex="^fixedquery$")] = None,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 5.2K bytes
    - Viewed (0)
  8. fastapi/__init__.py

    from .param_functions import Body as Body
    from .param_functions import Cookie as Cookie
    from .param_functions import Depends as Depends
    from .param_functions import File as File
    from .param_functions import Form as Form
    from .param_functions import Header as Header
    from .param_functions import Path as Path
    from .param_functions import Query as Query
    from .param_functions import Security as Security
    from .requests import Request as Request
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 15:19:50 UTC 2025
    - 1.1K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_request_files/test_tutorial002.py

    
    def test_get_root(app: FastAPI):
        client = TestClient(app)
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert b"<form" in response.content
    
    
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_request_files/test_tutorial001.py

                        "summary": "Create File",
                        "operationId": "create_file_files__post",
                        "requestBody": {
                            "content": {
                                "multipart/form-data": {
                                    "schema": {
                                        "$ref": "#/components/schemas/Body_create_file_files__post"
                                    }
                                }
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.1K bytes
    - Viewed (0)
Back to top