We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4945d35 commit fdcc789Copy full SHA for fdcc789
test_allocation.py
@@ -198,6 +198,20 @@ def test_prefer_allocating_to_earlier_even_if_multiple_shipments():
198
assert allocations['sku3'] == shipment2
199
200
201
+def test_stock_not_quite_enough_means_we_use_shipment():
202
+ order = {'sku1': 10, 'sku2': 10}
203
+ stock = {'sku1': 10, 'sku2': 5}
204
+ shipment = Shipment(eta=date.today(), lines={
205
+ 'sku1': 1000,
206
+ 'sku2': 1000,
207
+ })
208
+
209
+ allocations = allocate(order, stock, shipments=[shipment])
210
211
+ assert allocations['sku1'] == shipment
212
+ assert allocations['sku2'] == shipment
213
214
215
def test_cannot_allocate_if_insufficent_quantity_in_stock():
216
order = {'a-sku': 10}
217
stock = {'a-sku': 5}
0 commit comments