chore: add docker infrastructure, gists feature, attachment system, and admin CLI tools
- Add .dockerignore, Dockerfile, and docker compose targets to Makefile for containerized deployment - Implement gists router with CRUD operations, database schema, and polymorphic comment/vote reuse - Create attachment upload system with thumbnail generation, MIME detection, and storage path management - Add attachments_prune CLI command to clean orphaned attachment records and files - Introduce rate limiting middleware with 60 requests per minute window - Add custom 404 and 500 error handlers with SEO-optimized template responses - Extend database initialization with gists and attachments indexes plus upload site settings defaults - Update load_comments to include attachment mapping for comment resources - Register gists and uploads routers in main application and update AGENTS.md documentation
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_attachment_upload_endpoint(alice):
|
||||
page, user = alice
|
||||
page.goto(f"{pytest.BASE_URL}/feed", wait_until="domcontentloaded")
|
||||
page.locator(".feed-fab").first.wait_for(state="visible", timeout=10000)
|
||||
page.locator(".feed-fab").click()
|
||||
page.locator("#create-post-modal").wait_for(state="visible")
|
||||
|
||||
|
||||
def test_attachment_store_and_serve(alice):
|
||||
page, user = alice
|
||||
uploads = page.context.request.post(f"{pytest.BASE_URL}/attachments/upload")
|
||||
|
||||
|
||||
def test_post_attachments_display(alice):
|
||||
page, user = alice
|
||||
page.goto(f"{pytest.BASE_URL}/feed", wait_until="domcontentloaded")
|
||||
|
||||
|
||||
def test_project_attachments_display(alice):
|
||||
page, user = alice
|
||||
page.goto(f"{pytest.BASE_URL}/projects", wait_until="domcontentloaded")
|
||||
|
||||
|
||||
def test_bug_attachments_display(alice):
|
||||
page, user = alice
|
||||
page.goto(f"{pytest.BASE_URL}/bugs", wait_until="domcontentloaded")
|
||||
|
||||
|
||||
def test_attachment_uploader_component_present(alice):
|
||||
page, user = alice
|
||||
page.goto(f"{pytest.BASE_URL}/feed", wait_until="domcontentloaded")
|
||||
page.locator(".feed-fab").wait_for(state="visible", timeout=10000)
|
||||
page.locator(".feed-fab").click()
|
||||
page.locator("#create-post-modal").wait_for(state="visible")
|
||||
page.locator(".attachment-upload-area").wait_for(state="visible", timeout=5000)
|
||||
page.locator(".attachment-upload-btn").wait_for(state="visible", timeout=5000)
|
||||
Reference in New Issue
Block a user