feat: Dropstar's answers of 23/10 that need nothing more from them
All checks were successful
Build and deploy / Validate source (push) Successful in 1m6s
Build and deploy / Integration suite on a real stack (push) Successful in 4m5s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 2m6s

- JPG is refused in every product, at upload and by the server: it has no
  transparency, so the background prints and loose art packs as a box
- a PDF over 150 MB says before payment that the Site cannot check it, as a
  file opened by hand does
- every piece that is not square is tried both ways; the 1 cm rule left
  19,5 x 18,5 cm standing, 2 to a row instead of 3
- a mirrored order (UV only) is flagged on its card and panel, and its print
  file's footer ends in ESPELHADO, in bold
- print files are named DTF-23-item-1, and the order panel copies DTF-23-,
  so the code pasted into the folder's search finds them
- the proof: up to 30 cm, from the thinnest lines, a piece of each different
  artwork, at most three per order, free
- a file opened by hand costs R$ 2,00 more a metre by default, and the Site
  says so

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-26 09:33:22 -03:00
parent c21497d71b
commit a9253d830a
22 changed files with 160 additions and 67 deletions

View File

@@ -121,6 +121,20 @@ class PrintFileTests(unittest.TestCase):
plain = io.BytesIO()
self.assertEqual(render(spec, {0: (path, 'a.png')}, plain, 'test')['page_height_cm'], '10')
def test_a_mirrored_item_says_so_in_bold_at_the_end(self):
from datetime import datetime, timezone
from app.printfile import footer_commands
from app.printjobs import file_prefix, footer
spec = item([placement(0, 0, 20, 10, mirrored=True)], [source(20, 10, mirrored=True)], 10)
job = {'snapshot': {'items': [spec, spec]}, 'number': 7, 'item_index': 1,
'ordered_at': datetime(2026, 10, 23, 15, 0, tzinfo=timezone.utc)}
line = footer(job, spec)
self.assertEqual(line, 'DROPSTAR · Pedido DTF-7 · Item 2/2 · 23/10/2026 · 1,00 m · ESPELHADO')
self.assertIn(b'/F1 18 Tf ( \xb7 ESPELHADO) Tj', footer_commands(line, (100, 80)))
self.assertNotIn(b'ESPELHADO', footer_commands(footer(job, item([placement(0, 0, 20, 10)], [source(20, 10)], 10)), (100, 80)))
# The files start with the code the Kanban copies.
self.assertEqual(file_prefix(7, 1), 'DTF-7-item-2')
def test_jpeg_bytes_are_embedded_unchanged(self):
path = self.save(quadrants(), 'a.jpg', quality=90)
pdf, _ = self.render(item([placement(0, 0, 20, 10)], [source(20, 10)], 10), [path])