Skip to content

Commit 16f1c5b

Browse files
committed
hopefully this is the last one - fixed a test
1 parent ee424da commit 16f1c5b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/tests/unit/test_user.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from sqlalchemy.orm import sessionmaker
77

88
from app.models import Role
9+
from app.models.AvailableTime import available_times
10+
from app.models.TimeBlock import TimeBlock
911
from app.models.User import User
1012
from app.schemas.user import (
1113
SignUpMethod,
@@ -72,6 +74,9 @@ def db_session():
7274
# Create only the tables needed for these tests to avoid JSONB (Postgres-only) issues under SQLite
7375
Role.__table__.create(bind=engine, checkfirst=True)
7476
User.__table__.create(bind=engine, checkfirst=True)
77+
# Additional tables referenced by User relationships
78+
TimeBlock.__table__.create(bind=engine, checkfirst=True)
79+
available_times.create(bind=engine, checkfirst=True)
7580

7681
session = TestingSessionLocal()
7782

@@ -96,6 +101,8 @@ def db_session():
96101
session.rollback()
97102
session.close()
98103
# Clean up - drop only the tables we created
104+
available_times.drop(bind=engine, checkfirst=True)
105+
TimeBlock.__table__.drop(bind=engine, checkfirst=True)
99106
User.__table__.drop(bind=engine, checkfirst=True)
100107
Role.__table__.drop(bind=engine, checkfirst=True)
101108

0 commit comments

Comments
 (0)