def test_allocating_to_a_batch_reduces_the_available_quantity(): batch = Batch("batch-001", "SMALL-TABLE", qty=20, eta=date.today()) line = OrderLine('order-ref', "SMALL-TABLE", 2) batch.allocate(line) assert batch.available_quantity == 18
def test_allocating_to_a_batch_reduces_the_available_quantity(): batch = Batch(ref="batch-001", sku="SMALL-TABLE", purchased_quantity=20) line = OrderLine(orderid="order-ref", sku="SMALLs-TABLE", qty=2) batch.allocate(line) print(batch.allocations)