test updates to take into account exception management

This commit is contained in:
2025-09-27 13:47:36 +02:00
parent 3e720212d9
commit 6b9817f179
38 changed files with 2951 additions and 871 deletions

View File

@@ -106,3 +106,18 @@ def create_unique_product_factory():
def product_factory():
"""Fixture that provides a product factory function"""
return create_unique_product_factory()
@pytest.fixture
def test_product_with_stock(db, test_product, test_stock):
"""Product with associated stock record."""
# Ensure they're linked by GTIN
if test_product.gtin != test_stock.gtin:
test_stock.gtin = test_product.gtin
db.commit()
db.refresh(test_stock)
return {
'product': test_product,
'stock': test_stock
}