Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 137 for userIDs (0.18 seconds)

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

  1. tests/test_infer_param_optionality.py

    
    app.include_router(user_router, prefix="/users")
    app.include_router(item_router, prefix="/items")
    
    app.include_router(item_router, prefix="/users/{user_id}/items")
    
    
    client = TestClient(app)
    
    
    def test_get_users():
        """Check that /users returns expected data"""
        response = client.get("/users")
        assert response.status_code == 200, response.text
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 12.1K bytes
    - Click Count (0)
  2. tests/test_security_oauth2_optional_description.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
            }
        },
        description="OAuth2 security scheme",
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 9.1K bytes
    - Click Count (0)
  3. tests/test_tutorial/test_testing_dependencies/test_tutorial001.py

        client = test_module.client
        response = client.get("/users/")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "message": "Hello Users!",
            "params": {"q": None, "skip": 5, "limit": 10},
        }
    
    
    def test_override_in_users_with_q(test_module: ModuleType):
        client = test_module.client
        response = client.get("/users/?q=foo")
        assert response.status_code == 200, response.text
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 2.4K bytes
    - Click Count (0)
  4. docs/es/docs/tutorial/bigger-applications.md

    ### Incluir los `APIRouter`s para `users` y `items` { #include-the-apirouters-for-users-and-items }
    
    Ahora, incluyamos los `router`s de los submódulos `users` y `items`:
    
    {* ../../docs_src/bigger_applications/app_an_py39/main.py hl[10:11] title["app/main.py"] *}
    
    /// info | Información
    
    `users.router` contiene el `APIRouter` dentro del archivo `app/routers/users.py`.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Dec 16 16:33:45 GMT 2025
    - 19.6K bytes
    - Click Count (0)
  5. tests/test_tutorial/test_security/test_tutorial004.py

        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token(mod: ModuleType):
        client = TestClient(mod.app)
        access_token = get_access_token(client=client)
        response = client.get(
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Dec 26 10:43:02 GMT 2025
    - 13.3K bytes
    - Click Count (0)
  6. tests/test_security_oauth2.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
            }
        }
    )
    
    
    class User(BaseModel):
        username: str
    
    
    # Here we use string annotations to test them
    def get_current_user(oauth_header: "str" = Security(reusable_oauth2)):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 9K bytes
    - Click Count (0)
  7. tests/test_security_http_basic_realm_description.py

    security = HTTPBasic(realm="simple", description="HTTPBasic scheme")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPBasicCredentials = Security(security)):
        return {"username": credentials.username, "password": credentials.password}
    
    
    client = TestClient(app)
    
    
    def test_security_http_basic():
        response = client.get("/users/me", auth=("john", "secret"))
        assert response.status_code == 200, response.text
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 24 19:03:06 GMT 2025
    - 2.7K bytes
    - Click Count (0)
  8. docs/pt/docs/tutorial/bigger-applications.md

    ### *Operações de Rota* com `APIRouter` { #path-operations-with-apirouter }
    
    E então você o utiliza para declarar suas *operações de rota*.
    
    Utilize-o da mesma maneira que utilizaria a classe  `FastAPI`:
    
    {* ../../docs_src/bigger_applications/app_an_py39/routers/users.py hl[6,11,16] title["app/routers/users.py"] *}
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Dec 16 20:32:40 GMT 2025
    - 19.7K bytes
    - Click Count (0)
  9. tests/test_security_http_bearer.py

    app = FastAPI()
    
    security = HTTPBearer()
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    def test_security_http_bearer():
        response = client.get("/users/me", headers={"Authorization": "Bearer foobar"})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 24 19:03:06 GMT 2025
    - 2.1K bytes
    - Click Count (0)
  10. tests/test_security_http_bearer_description.py

    security = HTTPBearer(description="HTTP Bearer token scheme")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    def test_security_http_bearer():
        response = client.get("/users/me", headers={"Authorization": "Bearer foobar"})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 24 19:03:06 GMT 2025
    - 2.3K bytes
    - Click Count (0)
Back to Top