qa update into main #2

Merged
steve merged 39 commits from qa into master 2025-02-17 14:32:58 -05:00
2 changed files with 14 additions and 2 deletions
Showing only changes of commit 4fd9fc6221 - Show all commits

View File

@@ -92,8 +92,8 @@ async def update_post(id: str, post: dict,db: Session = Depends(get_db)):
db.refresh(db_post)
return {"message":"Post updated successfully","post":db_post}
@app.delete("/posts/{id}",db: Session = Depends(get_db))
async def delete_post(id: str, post: dict):
@app.delete("/posts/{id}")
async def delete_post(id: str, post: dict,db: Session = Depends(get_db)):
db_post = db.query(Post).filter(Post.id == id).first()
db.delete(db_post)
db.commit()

12
test_papi.py Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/env python3
from fastapi.testclient import TestClient
import papi
client = TestClient(papi)
def test_read_main():
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"message": "Hello World"}