@@ -251,11 +251,11 @@ def test_order_back_order_allowed(self):
251
251
# Now Ship the successfull order
252
252
order_status_update_url = reverse ('order-status-update' , args = [order_out_of_stock_response_with_stock_tracking_bo .data ['order_alias' ]])
253
253
approve = self .auth_client .patch (order_status_update_url , {"status" : OrderStatus .APPROVED }, format = 'json' )
254
- processing = self .auth_client .patch (order_status_update_url , {"status" : OrderStatus .PACKED }, format = 'json' )
254
+ packed = self .auth_client .patch (order_status_update_url , {"status" : OrderStatus .PACKED }, format = 'json' )
255
255
shipped = self .auth_client .patch (order_status_update_url , {"status" : OrderStatus .SHIPPED }, format = 'json' )
256
256
257
257
self .assertEqual (approve .status_code , status .HTTP_200_OK )
258
- self .assertEqual (processing .status_code , status .HTTP_200_OK )
258
+ self .assertEqual (packed .status_code , status .HTTP_400_BAD_REQUEST ) # as order is not reserved, mean is not in stock, so packing should not be allowed
259
259
260
260
self .assertEqual (shipped .status_code , status .HTTP_400_BAD_REQUEST ) # as order is not reserved, it should not be shipped
261
261
@@ -288,6 +288,10 @@ def test_order_back_order_allowed(self):
288
288
self .assertEqual (remained_stock_without_bo , 15 )
289
289
self .assertEqual (reserved_stock_without_bo , 8 )
290
290
291
+ # now pack
292
+ packed = self .auth_client .patch (order_status_update_url , {"status" : OrderStatus .PACKED }, format = 'json' )
293
+ self .assertEqual (packed .status_code , status .HTTP_200_OK ) # as order is reserved, it should be packed
294
+
291
295
# as enough stock is available and order is reserved, now ship the order
292
296
shipped = self .auth_client .put (order_status_update_url , {"status" : OrderStatus .SHIPPED }, format = 'json' )
293
297
self .assertEqual (shipped .status_code , status .HTTP_200_OK )
0 commit comments