예제 #1
0
def test_increments_version_number():
    line = OrderLine('oref', "SCANDI-PEN", 10)
    product = Product(sku="SCANDI-PEN",
                      batches=[Batch('b1', "SCANDI-PEN", 100, eta=None)])
    product.version_number = 7
    product.allocate(line)
    assert product.version_number == 8
예제 #2
0
<<<<<<< HEAD
    batch = Batch('batch1', 'SMALL-FORK', 10, eta=today)
    product = Product(sku="SMALL-FORK", batches=[batch])
    product.allocate(OrderLine('order1', 'SMALL-FORK', 10))

    allocation = product.allocate(OrderLine('order2', 'SMALL-FORK', 1))
=======
    batch = Batch("batch1", "SMALL-FORK", 10, eta=today)
    product = Product(sku="SMALL-FORK", batches=[batch])
    product.allocate(OrderLine("order1", "SMALL-FORK", 10))

    allocation = product.allocate(OrderLine("order2", "SMALL-FORK", 1))
>>>>>>> upstream/master
    assert product.events[-1] == events.OutOfStock(sku="SMALL-FORK")
    assert allocation is None


def test_increments_version_number():
<<<<<<< HEAD
    line = OrderLine('oref', "SCANDI-PEN", 10)
    product = Product(sku="SCANDI-PEN", batches=[Batch('b1', "SCANDI-PEN", 100, eta=None)])
=======
    line = OrderLine("oref", "SCANDI-PEN", 10)
    product = Product(
        sku="SCANDI-PEN", batches=[Batch("b1", "SCANDI-PEN", 100, eta=None)]
    )
>>>>>>> upstream/master
    product.version_number = 7
    product.allocate(line)
    assert product.version_number == 8