test updates to take into account exception management
This commit is contained in:
@@ -231,10 +231,13 @@ class TestProductService:
|
||||
|
||||
def test_get_stock_info_success(self, db, test_product_with_stock):
|
||||
"""Test getting stock info for product with stock"""
|
||||
stock_info = self.service.get_stock_info(db, test_product_with_stock.gtin)
|
||||
# Extract the product from the dictionary
|
||||
product = test_product_with_stock['product']
|
||||
|
||||
stock_info = self.service.get_stock_info(db, product.gtin)
|
||||
|
||||
assert stock_info is not None
|
||||
assert stock_info.gtin == test_product_with_stock.gtin
|
||||
assert stock_info.gtin == product.gtin
|
||||
assert stock_info.total_quantity > 0
|
||||
assert len(stock_info.locations) > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user