- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 23 for Users2 (0.03 sec)
-
tests/test_tutorial/test_path_params/test_tutorial003b.py
}, }, "description": "Successful Response", }, }, "summary": "Read Users2", }, }, },Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 1.3K bytes - Viewed (0) -
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
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 12.1K bytes - Viewed (0) -
tests/test_security_oauth2_optional_description.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 9.1K bytes - Viewed (0) -
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)):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 9K bytes - Viewed (0) -
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(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 13.3K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial007.py
def test_security_http_basic(client: TestClient): response = client.get("/users/me", auth=("stanleyjobson", "swordfish")) assert response.status_code == 200, response.text assert response.json() == {"username": "stanleyjobson"} def test_security_http_basic_no_credentials(client: TestClient): response = client.get("/users/me") assert response.json() == {"detail": "Not authenticated"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 3.2K bytes - Viewed (0) -
tests/test_security_oauth2_optional.py
from pydantic import BaseModel app = FastAPI() reusable_oauth2 = OAuth2( flows={ "password": { "tokenUrl": "token", "scopes": {"read:users": "Read the users", "write:users": "Create users"}, } }, auto_error=False, ) class User(BaseModel): username: str def get_current_user(oauth_header: Optional[str] = Security(reusable_oauth2)):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 8.9K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial002.py
return client def test_no_token(client: TestClient): 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(client: TestClient): response = client.get("/users/me", headers={"Authorization": "Bearer testtoken"})
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 2.2K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial005.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(scope="me", client=client) response = client.get(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 15.8K bytes - Viewed (0) -
tests/test_tutorial/test_bigger_applications/test_main.py
assert response.json() == { "openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": { "/users/": { "get": { "tags": ["users"], "summary": "Read Users", "operationId": "read_users_users__get", "parameters": [ {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 21.3K bytes - Viewed (0)