Finish off backend tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from sqlalchemy.orm import Session
|
||||
from fastapi import HTTPException
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from src.enums import CourseEnum
|
||||
from src.models import CourseProgress, User
|
||||
@@ -50,7 +50,9 @@ def initialize_user(db: Session, user: User):
|
||||
db.commit()
|
||||
|
||||
|
||||
def patch_course_progress(db: Session, user: User, course: CourseEnum, course_progress: CourseProgressBase):
|
||||
def patch_course_progress(
|
||||
db: Session, user: User, course: CourseEnum, course_progress: CourseProgressBase
|
||||
):
|
||||
"""Change the progress value for a given course"""
|
||||
if course_progress.progress_value > 1 or course_progress.progress_value < 0:
|
||||
raise HTTPException(status_code=400, detail="Invalid progress value")
|
||||
|
||||
Reference in New Issue
Block a user