Skip to content

Commit b1027ad

Browse files
committed
get rid of the word warehouse
1 parent 28934ac commit b1027ad

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎domain_model.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Shipment:
2222
def allocate_to_stock(line, stock):
2323
for stock_line in stock:
2424
if stock_line.sku == line.sku:
25-
line.allocation = 'warehouse'
25+
line.allocation = 'STOCK'
2626

2727
def allocate_to_shipments(line, shipments):
2828
for shipment in shipments:

‎test_allocation.py‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def random_id():
1616
return uuid.uuid4().hex[:10]
1717

1818

19-
def test_can_allocate_to_warehouse_stock():
19+
def test_can_allocate_to_stock():
2020
sku = random_id()
2121
order = [
2222
OrderLine(sku=sku, quantity=10),
@@ -25,7 +25,7 @@ def test_can_allocate_to_warehouse_stock():
2525

2626
allocate(order, stock, shipments=[])
2727

28-
assert order[0].allocation == 'warehouse'
28+
assert order[0].allocation == 'STOCK'
2929

3030

3131
def test_can_allocate_to_shipment():
@@ -74,7 +74,7 @@ def test_can_allocate_to_correct_shipment():
7474
assert order[0].allocation == shipment2.id
7575

7676

77-
def test_allocates_to_warehouse_stock_in_preference_to_shipment():
77+
def test_allocates_to_stock_in_preference_to_shipment():
7878
sku = random_id()
7979
order = [
8080
OrderLine(sku=sku, quantity=10),
@@ -86,7 +86,7 @@ def test_allocates_to_warehouse_stock_in_preference_to_shipment():
8686

8787
allocate(order, stock, shipments=[shipment])
8888

89-
assert order[0].allocation == 'warehouse'
89+
assert order[0].allocation == 'STOCK'
9090

9191

9292
def test_can_allocate_multiple_lines_to_wh():
@@ -101,8 +101,8 @@ def test_can_allocate_multiple_lines_to_wh():
101101
]
102102

103103
allocate(order, stock, shipments=[])
104-
assert order[0].allocation == 'warehouse'
105-
assert order[1].allocation == 'warehouse'
104+
assert order[0].allocation == 'STOCK'
105+
assert order[1].allocation == 'STOCK'
106106

107107

108108
def test_can_allocate_multiple_lines_to_shipment():
@@ -135,7 +135,7 @@ def test_can_allocate_to_both():
135135

136136
allocate(order, stock, shipments=[shipment])
137137

138-
assert order[0].allocation == 'warehouse'
138+
assert order[0].allocation == 'STOCK'
139139
assert order[1].allocation == shipment.id
140140

141141

@@ -161,6 +161,6 @@ def test_can_allocate_to_both_preferring_stock():
161161

162162
assert order[0].allocation == shipment.id
163163
assert order[1].allocation == shipment.id
164-
assert order[2].allocation == 'warehouse'
165-
assert order[3].allocation == 'warehouse'
164+
assert order[2].allocation == 'STOCK'
165+
assert order[3].allocation == 'STOCK'
166166

0 commit comments

Comments
 (0)