Updated test products to give greater variety
This commit is contained in:
		
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -5,6 +5,10 @@ | |||||||
| ### SQLite 3 Database ### | ### SQLite 3 Database ### | ||||||
| data/ | data/ | ||||||
| static/assets/img/products/ | static/assets/img/products/ | ||||||
|  | !static/assets/img/products/brake-disks.bmp | ||||||
|  | !static/assets/img/products/alloy.bmp | ||||||
|  | !static/assets/img/products/manifold.bmp | ||||||
|  | !static/assets/img/products/turbo.bmp | ||||||
|  |  | ||||||
| ### CICD Registration files ### | ### CICD Registration files ### | ||||||
| cicd/runner-data | cicd/runner-data | ||||||
|   | |||||||
| @@ -1,37 +1,37 @@ | |||||||
| INSERT INTO Users (first_name, last_name, username, email, phone, password, role) VALUES ("Luke", "Else", "lukejelse04", "test@test.com", "07498 289321", "test213", "Customer"); | INSERT INTO Users (first_name, last_name, username, email, phone, password, role) VALUES ("Luke", "Else", "lukejelse04", "test@test.com", "07498 289321", "test213", "Customer"); | ||||||
|  |  | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 1); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("12' Brake Disks", "brake-disks.bmp", "this is a product", 20.99, 1, 1, 10); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 1); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("Exhaust Manifold", "manifold.bmp", "This is a super cool product that can be installed into your car to take the gasses from the inside all the way to the outside. Mad I know.", 20.99, 1, 1, 9); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 1); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("Single Turbo", "turbo.bmp", "this is a product", 20.99, 1, 1, 0); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 2); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("Exhaust Manifold", "manifold.bmp", "This is a super cool product that can be installed into your car to take the gasses from the inside all the way to the outside. Mad I know.", 20.99, 1, 2, 4); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 2); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("12' Brake Disks", "brake-disks.bmp", "this is a product", 20.99, 1, 2, 3); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 3); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("17' Alloy Wheels", "alloy.bmp", "These super stylish alloys offer a fresh trendy look for your car. Whether a brand new Mercedes or a niffty little banger, it will uplift the vehicle 10-fold", 20.99, 1, 3, 9); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 4); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("Single Turbo", "turbo.bmp", "this is a product", 20.99, 1, 4, 3); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 4); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("Exhaust Manifold", "manifold.bmp", "This is a super cool product that can be installed into your car to take the gasses from the inside all the way to the outside. Mad I know.", 20.99, 1, 4, 2); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 4); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("17' Alloy Wheels", "alloy.bmp", "These super stylish alloys offer a fresh trendy look for your car. Whether a brand new Mercedes or a niffty little banger, it will uplift the vehicle 10-fold", 20.99, 1, 4, 1); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 6); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("Exhaust Manifold", "manifold.bmp", "This is a super cool product that can be installed into your car to take the gasses from the inside all the way to the outside. Mad I know.", 20.99, 1, 6, 7); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 6); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID, quantityAvailable) VALUES ("Single Turbo", "turbo.bmp", "this is a product", 20.99, 1, 6, 1232); | ||||||
|  |  | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 1); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("17' Alloy Wheels", "alloy.bmp", "These super stylish alloys offer a fresh trendy look for your car. Whether a brand new Mercedes or a niffty little banger, it will uplift the vehicle 10-fold", 20.99, 1, 1); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 1); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("Exhaust Manifold", "manifold.bmp", "This is a super cool product that can be installed into your car to take the gasses from the inside all the way to the outside. Mad I know.", 20.99, 1, 1); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 1); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("Single Turbo", "turbo.bmp", "this is a product", 20.99, 1, 1); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 2); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("17' Alloy Wheels", "alloy.bmp", "These super stylish alloys offer a fresh trendy look for your car. Whether a brand new Mercedes or a niffty little banger, it will uplift the vehicle 10-fold", 20.99, 1, 2); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 2); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("12' Brake Disks", "brake-disks.bmp", "this is a product", 20.99, 1, 2); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 3); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("17' Alloy Wheels", "alloy.bmp", "These super stylish alloys offer a fresh trendy look for your car. Whether a brand new Mercedes or a niffty little banger, it will uplift the vehicle 10-fold", 20.99, 1, 3); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 4); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("Exhaust Manifold", "manifold.bmp", "This is a super cool product that can be installed into your car to take the gasses from the inside all the way to the outside. Mad I know.", 20.99, 1, 4); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 4); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("Single Turbo", "turbo.bmp", "this is a product", 20.99, 1, 4); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 4); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("12' Brake Disks", "brake-disks.bmp", "this is a product", 20.99, 1, 4); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 6); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("12' Brake Disks", "brake-disks.bmp", "this is a product", 20.99, 1, 6); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 6); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("12' Brake Disks", "brake-disks.bmp", "this is a product", 20.99, 1, 6); | ||||||
|  |  | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 1); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("17' Alloy Wheels", "alloy.bmp", "These super stylish alloys offer a fresh trendy look for your car. Whether a brand new Mercedes or a niffty little banger, it will uplift the vehicle 10-fold", 20.99, 1, 1); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 1); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("Exhaust Manifold", "manifold.bmp", "This is a super cool product that can be installed into your car to take the gasses from the inside all the way to the outside. Mad I know.", 20.99, 1, 1); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 1); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("12' Brake Disks", "brake-disks.bmp", "this is a product", 20.99, 1, 1); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 2); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("Single Turbo", "turbo.bmp", "this is a product", 20.99, 1, 2); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 2); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("Single Turbo", "turbo.bmp", "this is a product", 20.99, 1, 2); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 3); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("17' Alloy Wheels", "alloy.bmp", "These super stylish alloys offer a fresh trendy look for your car. Whether a brand new Mercedes or a niffty little banger, it will uplift the vehicle 10-fold", 20.99, 1, 3); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 4); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("12' Brake Disks", "brake-disks.bmp", "this is a product", 20.99, 1, 4); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 4); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("17' Alloy Wheels", "alloy.bmp", "These super stylish alloys offer a fresh trendy look for your car. Whether a brand new Mercedes or a niffty little banger, it will uplift the vehicle 10-fold", 20.99, 1, 4); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 4); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("Single Turbo", "turbo.bmp", "this is a product", 20.99, 1, 4); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 6); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("Exhaust Manifold", "manifold.bmp", "This is a super cool product that can be installed into your car to take the gasses from the inside all the way to the outside. Mad I know.", 20.99, 1, 6); | ||||||
| INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "brake-disks.png", "this is a product", 20.99, 1, 6); | INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("17' Alloy Wheels", "alloy.bmp", "These super stylish alloys offer a fresh trendy look for your car. Whether a brand new Mercedes or a niffty little banger, it will uplift the vehicle 10-fold", 20.99, 1, 6); | ||||||
| @@ -49,10 +49,10 @@ def test_search_term(): | |||||||
|     db = ProductController() |     db = ProductController() | ||||||
|  |  | ||||||
|     # Check each search term for correct amount of test products |     # Check each search term for correct amount of test products | ||||||
|     assert len(db.read_all(search_term="test")) == 33 |     assert len(db.read_all(search_term="Alloy")) == 9 | ||||||
|     assert len(db.read_all("Car Parts", "test")) == 9 |     assert len(db.read_all("Car Parts", "tur")) == 2 | ||||||
|     assert len(db.read_all(search_term="product")) == 1 |     assert len(db.read_all(search_term="fold")) == 8 | ||||||
|     assert db.read_all(search_term="not_test") is None |     assert db.read_all(search_term="Twin") is None | ||||||
|  |  | ||||||
| # Test we the same product details get returned from the database | # Test we the same product details get returned from the database | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user