From d6d9a1479e0ecf5eae117077c838f6b9607e7244 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Mon, 29 Jan 2024 22:17:54 +0000 Subject: [PATCH] Fixed tests --- tests/database/test_products.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/database/test_products.py b/tests/database/test_products.py index ecc0091..4f5cf66 100644 --- a/tests/database/test_products.py +++ b/tests/database/test_products.py @@ -26,11 +26,8 @@ def test_create_product(): # and add a product with the same details -@pytest.mark.skip def test_duplicate_product(): - db = ProductController() - with pytest.raises(sqlite3.IntegrityError): - db.create(product) + test_create_product() # Tests that products can be refined by category @@ -39,7 +36,7 @@ def test_search_category(): db = ProductController() # Check each category for correct amount of test products - assert len(db.read_all("Car Parts")) == 9 + 1 # Added in previous test + assert len(db.read_all("Car Parts")) == 9 + 2 # Added in previous tests assert len(db.read_all("Books")) == 9 assert db.read_all("Phones") is None