Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for lighten (0.31 sec)

  1. tests/test_tutorial/test_response_model/test_tutorial003.py

    client = TestClient(app)
    
    
    def test_post_user():
        response = client.post(
            "/user/",
            json={
                "username": "foo",
                "password": "fighter",
                "email": "******@****.***",
                "full_name": "Grave Dohl",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == {
            "username": "foo",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  2. docs_src/response_change_status_code/tutorial001.py

    from fastapi import FastAPI, Response, status
    
    app = FastAPI()
    
    tasks = {"foo": "Listen to the Bar Fighters"}
    
    
    @app.put("/get-or-create-task/{task_id}", status_code=200)
    def get_or_create_task(task_id: str, response: Response):
        if task_id not in tasks:
            tasks[task_id] = "This didn't exist before"
            response.status_code = status.HTTP_201_CREATED
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 391 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_response_change_status_code/test_tutorial001.py

    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.put("/get-or-create-task/foo")
        print(response.content)
        assert response.status_code == 200, response.text
        assert response.json() == "Listen to the Bar Fighters"
        response = client.put("/get-or-create-task/bar")
        assert response.status_code == 201, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 521 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_response_model/test_tutorial003_01.py

    client = TestClient(app)
    
    
    def test_post_user():
        response = client.post(
            "/user/",
            json={
                "username": "foo",
                "password": "fighter",
                "email": "******@****.***",
                "full_name": "Grave Dohl",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == {
            "username": "foo",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_response_model/test_tutorial003_py310.py

        return client
    
    
    @needs_py310
    def test_post_user(client: TestClient):
        response = client.post(
            "/user/",
            json={
                "username": "foo",
                "password": "fighter",
                "email": "******@****.***",
                "full_name": "Grave Dohl",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == {
            "username": "foo",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_response_model/test_tutorial003_01_py310.py

        return client
    
    
    @needs_py310
    def test_post_user(client: TestClient):
        response = client.post(
            "/user/",
            json={
                "username": "foo",
                "password": "fighter",
                "email": "******@****.***",
                "full_name": "Grave Dohl",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == {
            "username": "foo",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.8K bytes
    - Viewed (0)
Back to top