feat: one order, one machine: UV and textile never share an order (Marcus, 2026-11-26)
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 7m56s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m16s
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 7m56s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m16s
The server refuses a cart (and a review) with UV and textile items; the Site says so as soon as the customer opens a product of the other line, or adds it, with "Finalizar este pedido" and "Trocar o carrinho por este item". Basic and premium textile still go together. Proof cards copy their order's items, so they follow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
29
tests/test_one_machine.py
Normal file
29
tests/test_one_machine.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""One order, one machine (Marcus, 2026-11-26): UV and textile never share an
|
||||
order; basic and premium textile may.
|
||||
|
||||
Run from the repository root: python3 -m unittest tests.test_one_machine -v.
|
||||
"""
|
||||
import unittest
|
||||
|
||||
from app.core.models import ONE_MACHINE, Item, check_one_machine
|
||||
from tests.test_sheet_trim import sheet_item
|
||||
|
||||
|
||||
def items(*modes):
|
||||
return [Item.model_validate(sheet_item(mode=mode)) for mode in modes]
|
||||
|
||||
|
||||
class OneMachineTests(unittest.TestCase):
|
||||
def test_uv_and_textile_never_share_an_order(self):
|
||||
for modes in (('file', 'uvfile'), ('premium', 'uvfile'), ('uvfile', 'file', 'file')):
|
||||
with self.assertRaises(ValueError) as caught:
|
||||
check_one_machine(items(*modes))
|
||||
self.assertEqual(str(caught.exception), ONE_MACHINE)
|
||||
|
||||
def test_one_line_passes(self):
|
||||
check_one_machine(items('file', 'premium', 'file'))
|
||||
check_one_machine(items('uvfile', 'uvfile'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user