test_authoring_pglisted
Install: claude install-skill jedbjorn/subfloor
# test_authoring_pg — Postgres test infra
Rules live in `test_authoring` — read it alongside. This skill = the test
infrastructure PATTERN for Postgres-backed forks.
**Your fork's `tests/conftest.py` is the source of truth** for the throwaway
DB's naming, what schema artifact seeds it (a live `schema.sql`, a squash, a
migration replay), and the fixture roster — read it before writing a test.
Everything below is the typical shape, not a contract; where your conftest
differs, the conftest wins. A fork may also ship its own superseding
test-authoring skill — if one is granted, prefer it.
## Foundation (typical shape)
`tests/conftest.py` creates a throwaway Postgres DB at session start, applies
the fork's schema artifact, seeds two tenants (Alice / Bob) + a shared system
shell, and drives the real app through `TestClient` with real auth.
**Key identities (an example roster — confirm against your conftest):**
| Name | Kind | ID |
|---|---|---|
| `USER_ADMIN` | admin user | 1 |
| `USER_A` / Alice | tenant user | 10 |
| `USER_B` / Bob | tenant user | 20 |
| `SHELL_SHARED` | shared system shell | 100 |
| `SHELL_A` / `SHELL_B` | per-tenant shells | 101 / 102 |
| `PROJ_A` / `PROJ_B` | per-tenant projects | 500 / 501 |
| `KEY_A` / `KEY_B` | shell bearer keys | `"ALICEKEY"` / `"BOBKEY"` |
**Throwaway DB setup:**
- An admin connection (`psycopg.connect(DATABASE_URL_ADMIN, autocommit=True)`)
creates a uniquely-named `<fork>_test_<unique>` database at session start
and drops it a