Add Stork family name board MVP with invite auth and votes.
Includes multilingual etymology fields, seed data for starter names, and CI-ready Python project layout.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""Shared fixtures for Stork API tests."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def client(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> TestClient:
|
||||
monkeypatch.setenv("STORK_DATA", str(tmp_path / "data"))
|
||||
monkeypatch.setenv("STORK_INVITE_TOKEN", "test-invite-token")
|
||||
monkeypatch.setenv("STORK_ADMIN_TOKEN", "test-admin-token")
|
||||
monkeypatch.setenv("STORK_COOKIE_SECURE", "false")
|
||||
|
||||
import stork.app as app_mod
|
||||
|
||||
importlib.reload(app_mod)
|
||||
with TestClient(app_mod.app) as test_client:
|
||||
yield test_client
|
||||
app_mod.store.close()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def authed(client: TestClient) -> TestClient:
|
||||
res = client.post(
|
||||
"/api/session",
|
||||
json={"invite": "test-invite-token", "display_name": "Aunt Mira"},
|
||||
)
|
||||
assert res.status_code == 200
|
||||
return client
|
||||
Reference in New Issue
Block a user