fix: review of phase-2 stage 0 and fronts 5, 6 and 11
All checks were successful
Build and deploy / Publish images (push) Successful in 1m5s
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 5m7s
Build and deploy / Secret scan and release gate (push) Successful in 6s

- A paid treatment adds its 24 h to Arte recebida's acceptable time, on
  the card and in Números (fronts 5 and 11).
- TINY_PRODUCT_TREATMENT is a required Tiny setting once the treatment
  has a price, instead of every treated order failing at the Tiny.
- A quote reads each PDF once: Files caches the header and the DPI.
- A proof made from the parent's final split into parts uses the part
  that holds the finest stroke, not the last one (0.1).
- Prumo report: one format line per item, the time from the claim (kept
  on the finished print file), and the stroke class in customer words.
- The Site says the Prumo checks the art, and a too-tall PNG no longer
  says "Este PDF".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-09 10:45:43 -03:00
parent 5a51084c8f
commit 5aafd9ee91
11 changed files with 227 additions and 37 deletions

View File

@@ -2,9 +2,25 @@
import unittest
from decimal import Decimal
from app.printjobs import proof_part
from app.printpng import proof_cut
class ProofPartTests(unittest.TestCase):
def test_one_part_keeps_the_same_fraction(self):
self.assertEqual(proof_part([100], 100, 0.5), (0, 0.5))
self.assertEqual(proof_part([30], 30, 0.8), (0, 0.8))
def test_the_part_holding_the_finest_stroke_is_chosen(self):
self.assertEqual(proof_part([1000, 1000, 1000], 3000, 0.1), (0, 0.3))
self.assertEqual(proof_part([1000, 1000, 1000], 3000, 0.5), (1, 0.5))
self.assertEqual(proof_part([1000, 1000, 1000], 3000, 0.75), (2, 0.25))
def test_the_fraction_is_recalculated_inside_the_chosen_part(self):
self.assertEqual(proof_part([1500, 1500], 3000, 0.75), (1, 0.5))
self.assertEqual(proof_part([1500, 1500], 3000, 1), (1, 1))
class ProofCutTests(unittest.TestCase):
def test_centres_the_window_on_the_finest_stroke(self):
self.assertEqual(proof_cut(100, 15, 0.5), [Decimal('42.5'), Decimal('57.5')])