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:
co-authored by
Claude Opus 5
parent
aa0e760615
commit
82356810ce
@@ -93,7 +93,8 @@ test.describe("Admin user management", () => {
|
||||
await page.getByRole("button", { name: "Save" }).click()
|
||||
|
||||
await expect(page.getByText("User updated successfully")).toBeVisible()
|
||||
await expect(page.getByText(updatedName)).toBeVisible()
|
||||
// Scoped to this run's row: earlier runs leave their own "Updated Name".
|
||||
await expect(userRow.getByText(updatedName)).toBeVisible()
|
||||
})
|
||||
|
||||
test("Delete a user successfully", async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user