test: Implement post-test database cleanup in workflow history test
This commit is contained in:
@@ -8,12 +8,17 @@ from sqlalchemy import delete
|
|||||||
def history_manager():
|
def history_manager():
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
manager = HistoryManager(settings.history_db_url)
|
manager = HistoryManager(settings.history_db_url)
|
||||||
with manager.get_session() as session:
|
|
||||||
session.execute(delete(Plot))
|
def cleanup():
|
||||||
session.execute(delete(Message))
|
with manager.get_session() as session:
|
||||||
session.execute(delete(Conversation))
|
session.execute(delete(Plot))
|
||||||
session.execute(delete(User))
|
session.execute(delete(Message))
|
||||||
return manager
|
session.execute(delete(Conversation))
|
||||||
|
session.execute(delete(User))
|
||||||
|
|
||||||
|
cleanup()
|
||||||
|
yield manager
|
||||||
|
cleanup()
|
||||||
|
|
||||||
def test_full_history_workflow(history_manager):
|
def test_full_history_workflow(history_manager):
|
||||||
# 1. Create and Authenticate User
|
# 1. Create and Authenticate User
|
||||||
|
|||||||
Reference in New Issue
Block a user