MCPcopy
hub / github.com/learnhouse/learnhouse / collection

Function collection

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

A public collection containing the test course.

(db, org, course)

Source from the content-addressed store, hash-verified

426
427@pytest.fixture
428async def collection(db, org, course):
429 """A public collection containing the test course."""
430 c = Collection(
431 id=1,
432 name="Test Collection",
433 description="A test collection",
434 public=True,
435 org_id=org.id,
436 collection_uuid="collection_test",
437 creation_date=str(datetime.now()),
438 update_date=str(datetime.now()),
439 )
440 db.add(c)
441 await db.commit()
442 await db.refresh(c)
443 link = CollectionCourse(
444 collection_id=c.id,
445 course_id=course.id,
446 org_id=org.id,
447 creation_date=str(datetime.now()),
448 update_date=str(datetime.now()),
449 )
450 db.add(link)
451 await db.commit()
452 return c
453
454
455# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

CollectionClass · 0.90
CollectionCourseClass · 0.90
commitMethod · 0.80

Tested by

no test coverage detected