Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 45 for _body (0.02 sec)

  1. tests/test_params_repr.py

    def test_body_repr_str():
        assert repr(Body("teststr")) == "Body(teststr)"
    
    
    def test_body_repr_none():
        assert repr(Body(None)) == "Body(None)"
    
    
    def test_body_repr_ellipsis():
        assert repr(Body(...)) == "Body(PydanticUndefined)"
    
    
    def test_body_repr_number():
        assert repr(Body(1)) == "Body(1)"
    
    
    def test_body_repr_list():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  2. tests/test_request_params/test_body/test_required_str.py

        response = client.post(path, json=json)
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
                    "type": "missing",
                    "loc": IsOneOf(["body"], ["body", "p"]),
                    "msg": "Field required",
                    "input": IsOneOf(None, {}),
                }
            ]
        }
    
    
    @pytest.mark.parametrize(
        "path",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 11K bytes
    - Viewed (0)
  3. tests/test_request_params/test_form/test_required_str.py

        response = client.post(path)
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
                    "type": "missing",
                    "loc": ["body", "p"],
                    "msg": "Field required",
                    "input": IsOneOf(None, {}),
                }
            ]
        }
    
    
    @pytest.mark.parametrize(
        "path",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  4. tests/test_request_params/test_file/test_list.py

        response = client.post(path)
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
                    "type": "missing",
                    "loc": ["body", "p"],
                    "msg": "Field required",
                    "input": None,
                }
            ]
        }
    
    
    @pytest.mark.parametrize(
        "path",
        [
            "/list-bytes",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_form_models/test_tutorial001.py

        assert response.json() == {
            "detail": [
                {
                    "type": "missing",
                    "loc": ["body", "username"],
                    "msg": "Field required",
                    "input": {},
                },
                {
                    "type": "missing",
                    "loc": ["body", "password"],
                    "msg": "Field required",
                    "input": {},
                },
            ]
        }
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_forms/test_tutorial001.py

        assert response.json() == {
            "detail": [
                {
                    "type": "missing",
                    "loc": ["body", "username"],
                    "msg": "Field required",
                    "input": None,
                },
                {
                    "type": "missing",
                    "loc": ["body", "password"],
                    "msg": "Field required",
                    "input": None,
                },
            ]
        }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_body/test_tutorial001.py

            "detail": [
                {
                    "type": "missing",
                    "loc": ["body", "name"],
                    "msg": "Field required",
                    "input": {},
                },
                {
                    "type": "missing",
                    "loc": ["body", "price"],
                    "msg": "Field required",
                    "input": {},
                },
            ]
        }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  8. tests/test_schema_extra_examples.py

            @app.post("/example/")
            def example(item: Item = Body(example={"data": "Data in Body example"})):
                return item
    
        @app.post("/examples/")
        def examples(
            item: Item = Body(
                examples=[
                    {"data": "Data in Body examples, example1"},
                    {"data": "Data in Body examples, example2"},
                ],
            ),
        ):
            return item
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 32.2K bytes
    - Viewed (0)
  9. tests/test_forms_single_model.py

            "detail": [
                {
                    "type": "missing",
                    "loc": ["body", "username"],
                    "msg": "Field required",
                    "input": {"tags": ["foo", "bar"], "with": "nothing"},
                },
                {
                    "type": "missing",
                    "loc": ["body", "lastname"],
                    "msg": "Field required",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 3.4K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_body_multiple_params/test_tutorial003.py

        assert response.json() == {
            "detail": [
                {
                    "type": "missing",
                    "loc": ["body", "item"],
                    "msg": "Field required",
                    "input": None,
                },
                {
                    "type": "missing",
                    "loc": ["body", "user"],
                    "msg": "Field required",
                    "input": None,
                },
                {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.4K bytes
    - Viewed (0)
Back to top