MCPcopy
hub / github.com/learnhouse/learnhouse / chapter

Function chapter

apps/api/src/tests/conftest.py:362–387  ·  view source on GitHub ↗

A chapter linked to the test course.

(db, org, course)

Source from the content-addressed store, hash-verified

360
361@pytest.fixture
362async def chapter(db, org, course):
363 """A chapter linked to the test course."""
364 ch = Chapter(
365 id=1,
366 name="Test Chapter",
367 description="A test chapter",
368 org_id=org.id,
369 course_id=course.id,
370 chapter_uuid="chapter_test",
371 creation_date=str(datetime.now()),
372 update_date=str(datetime.now()),
373 )
374 db.add(ch)
375 await db.commit()
376 await db.refresh(ch)
377 link = CourseChapter(
378 chapter_id=ch.id,
379 course_id=course.id,
380 org_id=org.id,
381 order=1,
382 creation_date=str(datetime.now()),
383 update_date=str(datetime.now()),
384 )
385 db.add(link)
386 await db.commit()
387 return ch
388
389
390@pytest.fixture

Callers

nothing calls this directly

Calls 3

ChapterClass · 0.90
CourseChapterClass · 0.90
commitMethod · 0.80

Tested by

no test coverage detected