A chapter linked to the test course.
(db, org, course)
| 360 | |
| 361 | @pytest.fixture |
| 362 | async 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 |
nothing calls this directly
no test coverage detected