49 lines
1.4 KiB
Markdown
49 lines
1.4 KiB
Markdown
# Remove Demo Study Seed Implementation Plan
|
|
|
|
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
|
|
|
|
**Goal:** Stop development initialization from auto-creating any demo study or fee data.
|
|
|
|
**Architecture:** Remove the application startup hook that seeds demo fee data, while keeping schema setup and protected admin initialization intact. Add a regression test that proves the lifespan startup no longer calls the demo seed helper.
|
|
|
|
**Tech Stack:** FastAPI, pytest, unittest.mock
|
|
|
|
---
|
|
|
|
### Task 1: Lock the startup behavior with a failing test
|
|
|
|
**Files:**
|
|
- Create: `backend/tests/test_app_startup.py`
|
|
- Modify: `backend/app/main.py`
|
|
|
|
**Step 1: Write the failing test**
|
|
|
|
```python
|
|
async def test_development_startup_does_not_seed_demo_fees():
|
|
...
|
|
```
|
|
|
|
**Step 2: Run test to verify it fails**
|
|
|
|
Run: `pytest backend/tests/test_app_startup.py -q`
|
|
Expected: FAIL because startup still calls `seed_demo_fees`.
|
|
|
|
**Step 3: Write minimal implementation**
|
|
|
|
Remove the `seed_demo_fees` import and startup call from `backend/app/main.py`.
|
|
|
|
**Step 4: Run test to verify it passes**
|
|
|
|
Run: `pytest backend/tests/test_app_startup.py -q`
|
|
Expected: PASS.
|
|
|
|
### Task 2: Verify no regression in admin bootstrap
|
|
|
|
**Files:**
|
|
- Test: `backend/tests/test_protected_admin.py`
|
|
|
|
**Step 1: Run targeted regression tests**
|
|
|
|
Run: `pytest backend/tests/test_app_startup.py backend/tests/test_protected_admin.py -q`
|
|
Expected: PASS.
|