Update code via agent code generation

This commit is contained in:
Automated Action 2025-05-11 19:17:23 +00:00
parent f27201a3a6
commit fff806fd2f
11 changed files with 25 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

25
test_db.py Normal file
View File

@ -0,0 +1,25 @@
from app.db.session import SessionLocal
from app.models.todo import Todo
# Create a database session
db = SessionLocal()
try:
# Create a test todo
test_todo = Todo(
title="Test Todo",
description="This is a test todo created to verify database operations",
)
db.add(test_todo)
db.commit()
db.refresh(test_todo)
print(f"Created Todo with ID: {test_todo.id}")
# Query and list all todos
todos = db.query(Todo).all()
print(f"Found {len(todos)} todos in the database:")
for todo in todos:
print(f" - {todo.id}: {todo.title} (Completed: {todo.completed})")
finally:
db.close()