6a2a9d2c87
Backend: - Add user_feedback table with RLS policy - Create feedback submission API (multipart/form-data) - Implement xlsx report generation with embedded images - Add scheduled email delivery via Feishu SMTP - Create HTML email templates (daily_report, no_feedback) Frontend: - Add feedback screen with type selection and image picker - Support anonymous submission via skipAuth flag - Collect device info and app version Protocol: - Document feedback API contract and error codes - Update http-error-codes.md with FEEDBACK_* codes
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
import os
|
|
import time
|
|
|
|
import pytest
|
|
|
|
|
|
def pytest_configure(config): # noqa: ARG001
|
|
config.addinivalue_line(
|
|
"markers", "integration: integration test requiring live backend"
|
|
)
|
|
|
|
|
|
def pytest_collection_modifyitems(items):
|
|
for item in items:
|
|
if "integration" in item.nodeid:
|
|
item.add_marker(pytest.mark.integration)
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def api_base_url() -> str:
|
|
return os.environ.get("ERYAO_TEST_BASE_URL", "http://localhost:5775")
|
|
|
|
|
|
@pytest.fixture
|
|
def unique_test_email() -> str:
|
|
base_email = os.environ.get("ERYAO_TEST__EMAIL", "test@example.com").strip().lower()
|
|
if "@" in base_email:
|
|
name, domain = base_email.split("@", 1)
|
|
else:
|
|
name, domain = base_email, "example.com"
|
|
return f"{name}+fb{int(time.time() * 1000)}@{domain}"
|
|
|
|
|
|
@pytest.fixture
|
|
def test_verify_code() -> str:
|
|
return os.environ.get("ERYAO_TEST__CODE", "123456")
|
|
|
|
|
|
@pytest.fixture
|
|
def test_identity(unique_test_email: str, test_verify_code: str) -> dict[str, str]:
|
|
return {"email": unique_test_email, "code": test_verify_code}
|