Give the tests their own database and drop the template specs

pytest was deleting every user on teardown against the development
database. The engine is built at import time, so tests/__init__.py pins
POSTGRES_DB before app.core.config loads; the fixture creates the schema
and drops the database again, guarded against a name that is not _test.

Playwright now defaults at the integrated stack, which is the origin the
API allows, so a bare `bunx playwright test` works without a dev server.
The four template specs that asserted copy we no longer ship are gone,
along with the helpers they were the last callers of. The admin edit
assertion was page-wide and only ever passed on a fresh database.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkmeRiyeYmVZqJVwuyHq9o
This commit is contained in:
Melvin Strobl
2026-08-15 21:19:12 +02:00
co-authored by Claude Opus 5
parent aa0e760615
commit 82356810ce
11 changed files with 40 additions and 858 deletions
+4 -14
View File
@@ -23,10 +23,10 @@ export default defineConfig({
reporter: process.env.CI ? 'blob' : 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`.
Point PLAYWRIGHT_BASE_URL at the integrated stack (http://app.localhost)
to test what `make dev` is serving; the API only allows CORS from there. */
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173',
/* Base URL to use in actions like `await page.goto('/')`. Defaults to the
integrated stack (`make dev`), the only origin the API allows CORS from.
Point PLAYWRIGHT_BASE_URL elsewhere to test another running server. */
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://app.localhost',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
@@ -83,14 +83,4 @@ export default defineConfig({
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],
/* Run your local dev server before starting the tests, unless we were
pointed at an already-running one. */
webServer: process.env.PLAYWRIGHT_BASE_URL
? undefined
: {
command: 'bun run dev',
url: 'http://localhost:5173',
reuseExistingServer: !process.env.CI,
},
});