[Tests] Fix tests for new model
This commit is contained in:
@@ -3,6 +3,7 @@ from fastapi.testclient import TestClient
|
||||
from sqlmodel import Session, create_engine, SQLModel
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from sqlalchemy.pool import StaticPool
|
||||
from datetime import time
|
||||
|
||||
from app.main import app
|
||||
from app.model.models import UserDB, Card, GroupDB, AccessAuthorizationDB, Timetable, AaGroupLink
|
||||
@@ -107,11 +108,18 @@ def test_card(db_session, test_group):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_aa(db_session):
|
||||
"""Create a test access authorization."""
|
||||
def test_aa_tt(db_session):
|
||||
"""Create a test access authorization with timetable."""
|
||||
tt = Timetable(
|
||||
weekday=1,
|
||||
starttime=time(1, 0, 0, 0),
|
||||
duration=50
|
||||
)
|
||||
aa = AccessAuthorizationDB(
|
||||
name="Test AA",
|
||||
is_active=True
|
||||
is_active=True,
|
||||
type="timetable",
|
||||
timetables=[tt]
|
||||
)
|
||||
db_session.add(aa)
|
||||
db_session.commit()
|
||||
|
||||
Reference in New Issue
Block a user