test: 81 unit tests for tickets (data, storage, transcript, ui)
All checks were successful
ci / ci (push) Successful in 1m3s
All checks were successful
ci / ci (push) Successful in 1m3s
- tests/test_data.py: models serialization, enums, roundtrip - tests/test_storage.py: CRUD JSON, cache, persistence - tests/test_transcript.py: HTML generation, escaping, attachments - tests/test_ui.py: button callbacks with mocked interactions - Fixed: transcript.py attachments access (dataclass not dict)
This commit is contained in:
parent
628e02aea9
commit
e771073909
5 changed files with 812 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ def generate_transcript(ticket: TicketData, guild_name: str = "") -> str:
|
|||
badge = '<span class="badge badge-staff">STAFF</span>' if msg.is_staff else ""
|
||||
|
||||
att_html = ""
|
||||
for att in msg.get("attachments", []) if hasattr(msg, "attachments") else msg.attachments:
|
||||
for att in msg.attachments:
|
||||
if any(att.lower().endswith(ext) for ext in (".png", ".jpg", ".jpeg", ".gif", ".webp")):
|
||||
att_html += f'<div class="attachment"><img src="{html.escape(att)}" /></div>'
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue