test updates to take into account exception management
This commit is contained in:
15
tests/fixtures/product_fixtures.py
vendored
15
tests/fixtures/product_fixtures.py
vendored
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user