Files
devplacepy/tests/e2e/issues/attachments.py
T
retoor 7bbaf51450 feat: add file attachment support to issue tracker with Gitea mirroring
Implement full attachment CRUD for issues and comments, restricted to open issues only. Attachments are stored locally and mirrored to the Gitea tracker via new `mirror_attachment_to_gitea` and `set_gitea_asset_id` functions. Add `gitea_asset_id` column to the attachments table, extend `IssueForm` and `IssueCommentForm` with `attachment_uids` field, and expose new API endpoints for listing, adding, and deleting issue attachments. Update agent configuration to include web research tools, and document the new capability in README, AGENTS.md, and CLAUDE.md.
2026-06-19 11:22:05 +00:00

37 lines
1.0 KiB
Python

# retoor <retoor@molodetz.nl>
import io
import re
from PIL import Image
from playwright.sync_api import expect
from tests.conftest import BASE_URL
def _png():
buf = io.BytesIO()
Image.new("RGB", (8, 8), (0, 128, 255)).save(buf, "PNG")
return buf.getvalue()
def test_create_modal_collects_attachment_uid(alice):
page, _ = alice
page.goto(f"{BASE_URL}/issues", wait_until="domcontentloaded")
page.click("button[data-modal='create-issue-modal']")
page.locator("#create-issue-modal").wait_for(state="visible")
file_input = page.locator(
"#create-issue-modal dp-upload .dp-upload-input"
).first
file_input.set_input_files(
{"name": "shot.png", "mimeType": "image/png", "buffer": _png()}
)
page.locator(
"#create-issue-modal dp-upload .dp-upload-count"
).first.wait_for(state="visible", timeout=15000)
expect(
page.locator(
"#create-issue-modal dp-upload input[name='attachment_uids']"
)
).to_have_value(re.compile(r".+"))