Fixed tests

This commit is contained in:
Luke Else 2024-01-29 22:17:54 +00:00
parent 482b6a633b
commit d6d9a1479e

View File

@ -26,11 +26,8 @@ def test_create_product():
# and add a product with the same details # and add a product with the same details
@pytest.mark.skip
def test_duplicate_product(): def test_duplicate_product():
db = ProductController() test_create_product()
with pytest.raises(sqlite3.IntegrityError):
db.create(product)
# Tests that products can be refined by category # Tests that products can be refined by category
@ -39,7 +36,7 @@ def test_search_category():
db = ProductController() db = ProductController()
# Check each category for correct amount of test products # 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 len(db.read_all("Books")) == 9
assert db.read_all("Phones") is None assert db.read_all("Phones") is None