Get started with user tests

This commit is contained in:
lvrossem
2023-04-09 13:39:52 -06:00
parent 101cd899c3
commit 8f3c303a2b
6 changed files with 162 additions and 39 deletions

View File

@@ -2,6 +2,7 @@ from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from src.database import Base
from src.models import CourseProgress, HighScore, User
SQLALCHEMY_DATABASE_URL = "postgresql://admin:WeSign123!@localhost/wesigntest"
@@ -12,6 +13,15 @@ TestSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base.metadata.create_all(bind=engine)
def clear_db():
db = TestSessionLocal()
db.query(HighScore).delete()
db.query(CourseProgress).delete()
db.query(User).delete()
db.commit()
def override_get_db():
try:
db = TestSessionLocal()