Files
devplacepy/tests/e2e/admin/services/clearlogs.py
T
retoor 43f4011005 chore: reorganize test files into domain-specific subdirectories under tests/
Split the monolithic test directory into three tiers (unit, api, e2e) with a path-mirroring directory structure. Added corresponding Makefile targets (test-unit, test-api, test-e2e) and updated all documentation references (CLAUDE.md, README.md, testing-cicd.html, testing-framework.html, testing-make.html) to reflect the new layout and naming conventions.
2026-06-13 14:32:33 +00:00

21 lines
704 B
Python

# retoor <retoor@molodetz.nl>
from tests.conftest import BASE_URL, login_user
from devplacepy.database import get_table
def _promote_to_admin(username: str) -> None:
users = get_table("users")
user = users.find_one(username=username)
if user:
users.update({"uid": user["uid"], "role": "Admin"}, ["uid"])
def test_services_clear_logs(page, seeded_db):
user = seeded_db["alice"]
_promote_to_admin(user["username"])
login_user(page, user)
page.goto(f"{BASE_URL}/admin/services", wait_until="domcontentloaded")
resp = page.request.post(f"{BASE_URL}/admin/services/news/clear-logs")
assert resp.status == 200
data = resp.json()
assert data["ok"] is True