fix: the server refuses stacked pieces and files laid out at other proportions, and never cuts a strip with ink
Some checks failed
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Publish images (push) Has been cancelled
Build and deploy / Secret scan and release gate (push) Has been cancelled
Build and deploy / Integration suite on a real stack (push) Has been cancelled
Some checks failed
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Publish images (push) Has been cancelled
Build and deploy / Secret scan and release gate (push) Has been cancelled
Build and deploy / Integration suite on a real stack (push) Has been cancelled
The price came from the layout the browser sent, checked only in part: - Pieces on top of each other passed: 100 copies stacked in one place bill 10 cm and print over each other. The layout validator now refuses any overlap. - A file laid out at proportions it does not have (a 5 m sheet sent as 10 cm) was found only by the print file, after payment. The quote now checks each raster file's proportions from the bytes it already reads. - The empty strips the Site cuts from a ready sheet were cut on its word. The print file now reads them: a strip with ink sends the item to hand preparation with the reason, instead of printing the art cut off. Test fixtures that laid real images out at impossible proportions now keep the image's own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,12 +40,13 @@ def quote(client, item, mail, expected=200):
|
||||
|
||||
|
||||
def arts_item(upload_id, arts):
|
||||
"""One loose-art item with `arts` sources of 10 x 10 cm, one metre long."""
|
||||
sources = [{'upload_id': upload_id, 'kind': 'artwork', 'width_cm': 10, 'length_cm': 10,
|
||||
"""One loose-art item with `arts` sources of 10 x 5 cm (artwork() is 2:1),
|
||||
one every 10 cm."""
|
||||
sources = [{'upload_id': upload_id, 'kind': 'artwork', 'width_cm': 10, 'length_cm': 5,
|
||||
'copies': 1, 'rotation_degrees': 0, 'mirrored': False,
|
||||
'measurement': 'customer'} for _ in range(arts)]
|
||||
placements = [{'source_index': index, 'copy_index': 0, 'x_cm': 0, 'y_cm': index * 10,
|
||||
'width_cm': 10, 'length_cm': 10, 'rotation_degrees': 0, 'mirrored': False}
|
||||
'width_cm': 10, 'length_cm': 5, 'rotation_degrees': 0, 'mirrored': False}
|
||||
for index in range(arts)]
|
||||
return {'mode': 'avulsa', 'metres': '1', 'grade': 90, 'uploads': [upload_id] * arts,
|
||||
'production': {'version': 3, 'film_width_cm': 57, 'height_cm': arts * 10,
|
||||
@@ -76,7 +77,7 @@ def run():
|
||||
assert premium_entry['title'] == 'Têxtil Premium · 8 passadas', premium_entry
|
||||
assert client.call('/session')['products'][PREMIUM]['enabled'] is False
|
||||
premium_item = {**item_spec(PREMIUM, '1', 0, upload_bytes(
|
||||
client, premium_sheet(), name='LOCAL-SITE-PREMIUM.png')),
|
||||
client, premium_sheet(), name='LOCAL-SITE-PREMIUM.png'), aspect=3),
|
||||
'quality_status': 'warning', 'quality_acknowledged': True}
|
||||
refused = quote(client, premium_item, mail, expected=422)
|
||||
assert refused['detail'] == 'Este produto não está à venda agora.', refused
|
||||
@@ -188,7 +189,7 @@ def run():
|
||||
|
||||
manager.call(f'/operator/site/products/{UV}', {'enabled': True})
|
||||
uid = upload_bytes(client, artwork(), name='LOCAL-SITE-ADMIN.png')
|
||||
item = {**item_spec('uv', '1', 0, uid), 'quality_status': 'warning', 'quality_acknowledged': True}
|
||||
item = {**item_spec('uv', '1', 0, uid, aspect=2), 'quality_status': 'warning', 'quality_acknowledged': True}
|
||||
before = client.call('/session')['products'][UV]['unit_cents']
|
||||
|
||||
# Switched off: the Site sees it off and the server refuses a new quote.
|
||||
|
||||
Reference in New Issue
Block a user