Browse Source

🎨 Auto format

pull/14647/head
pre-commit-ci-lite[bot] 6 months ago
committed by GitHub
parent
commit
b113e58ab7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      tests/test_security_http_basic_default_realm.py

3
tests/test_security_http_basic_default_realm.py

@ -5,12 +5,15 @@ from fastapi.testclient import TestClient
app = FastAPI()
security = HTTPBasic()
@app.get("/users/me")
def read_current_user(credentials: HTTPBasicCredentials = Depends(security)):
return {"username": credentials.username, "password": credentials.password}
client = TestClient(app)
def test_security_http_basic_default_realm():
# 401 branch: should include default realm
response = client.get("/users/me")

Loading…
Cancel
Save