mobiledev/taskflow

TaskFlow, a team task board you run from the web or from Claude and ChatGPT. FastAPI + DataK3 + appid + Models + MCP.

A remix template · 0 remixes · Remix mobiledev/taskflow

tests/conftest.py

import os
import sys
from datetime import date

import pytest

HERE = os.path.dirname(__file__)
sys.path[:0] = [HERE, os.path.join(HERE, "..", "app")]

from fakes import FakeAI, MemoryRepo  # noqa: E402
from taskflow.application.use_cases import TaskFlow  # noqa: E402
from taskflow.domain.model import Person  # noqa: E402

TODAY = date(2026, 11, 2)
OWNER, MEMBER, VIEWER, STRANGER = (Person(e) for e in
                                   ("ana@x.io", "bo@x.io", "cy@x.io", "dee@x.io"))


@pytest.fixture
def app():
    return TaskFlow(MemoryRepo(), FakeAI(), today=lambda: TODAY)


@pytest.fixture
def ops(app):
    """The Ops board: Ana owns it, Bo is a member, Cy can only look."""
    board = app.create_board(OWNER, "Ops")
    app.add_member(OWNER, board["id"], MEMBER.email, "member")
    app.add_member(OWNER, board["id"], VIEWER.email, "viewer")
    return board["id"]