diff --git a/tests/fertiscan/db/test_label.py b/tests/fertiscan/db/test_label.py index ee886bb3..d92ef205 100644 --- a/tests/fertiscan/db/test_label.py +++ b/tests/fertiscan/db/test_label.py @@ -72,14 +72,13 @@ def test_get_label_information(self): self.assertEqual(label_data[1], self.product_name) self.assertEqual(label_data[2], self.lot_number) self.assertEqual(label_data[3], self.npk) - self.assertEqual(label_data[4], self.registration_number) - self.assertEqual(label_data[5], self.n) - self.assertEqual(label_data[6], self.p) - self.assertEqual(label_data[7], self.k) - self.assertEqual(label_data[8], self.guaranteed_analysis_title_en) - self.assertEqual(label_data[9], self.guaranteed_analysis_title_fr) - self.assertEqual(label_data[10], self.guaranteed_is_minimal) - self.assertIsNone(label_data[12]) + self.assertEqual(label_data[4], self.n) + self.assertEqual(label_data[5], self.p) + self.assertEqual(label_data[6], self.k) + self.assertEqual(label_data[7], self.guaranteed_analysis_title_en) + self.assertEqual(label_data[8], self.guaranteed_analysis_title_fr) + self.assertEqual(label_data[9], self.guaranteed_is_minimal) + self.assertIsNone(label_data[10]) def test_get_label_information_json(self): label_information_id = label.new_label_information( diff --git a/tests/fertiscan/db/update_inspection/test_update_guaranteed.py b/tests/fertiscan/db/update_inspection/test_update_guaranteed.py index 984879bc..13d62bad 100644 --- a/tests/fertiscan/db/update_inspection/test_update_guaranteed.py +++ b/tests/fertiscan/db/update_inspection/test_update_guaranteed.py @@ -74,34 +74,6 @@ def setUp(self): } } - # Insert test data to obtain a valid label_id - sample_org_info = json.dumps( - { - "name": "Test Company", - "address": "123 Test Address", - "website": "http://www.testcompany.com", - "phone_number": "+1 800 555 0123", - } - ) - self.cursor.execute("SELECT upsert_organization_info(%s);", (sample_org_info,)) - self.company_info_id = self.cursor.fetchone()[0] - - self.label_id = label.new_label_information( - self.cursor, - "test-label", - None, - None, - None, - None, - None, - None, - None, - None, - self.company_info_id, - self.company_info_id, - None, - ) - def tearDown(self): # Rollback any changes to leave the database state as it was before the test self.conn.rollback() diff --git a/tests/fertiscan/db/update_inspection/test_update_ingredients.py b/tests/fertiscan/db/update_inspection/test_update_ingredients.py index 9711673c..ffb00300 100644 --- a/tests/fertiscan/db/update_inspection/test_update_ingredients.py +++ b/tests/fertiscan/db/update_inspection/test_update_ingredients.py @@ -67,34 +67,6 @@ def setUp(self): } ) - # Insert test data to obtain a valid label_id - sample_org_info = json.dumps( - { - "name": "Test Company", - "address": "123 Test Address", - "website": "http://www.testcompany.com", - "phone_number": "+1 800 555 0123", - } - ) - self.cursor.execute("SELECT upsert_organization_info(%s);", (sample_org_info,)) - self.company_info_id = self.cursor.fetchone()[0] - - self.label_id = label.new_label_information( - self.cursor, - "test-label", - None, - None, - None, - None, - None, - None, - None, - False, - self.company_info_id, - self.company_info_id, - None, - ) - def tearDown(self): # Rollback any changes to leave the database state as it was before the test self.conn.rollback() diff --git a/tests/fertiscan/db/update_inspection/test_update_inspection.py b/tests/fertiscan/db/update_inspection/test_update_inspection.py index ab46827e..58c49175 100644 --- a/tests/fertiscan/db/update_inspection/test_update_inspection.py +++ b/tests/fertiscan/db/update_inspection/test_update_inspection.py @@ -68,7 +68,7 @@ def setUp(self): create_input_json = json.load(file) create_input_json_str = json.dumps(create_input_json) - print(create_input_json["organizations"]) + #print(create_input_json["organizations"]) # Create initial inspection data in the database self.picture_set_id = None # No picture set ID for this test case @@ -77,15 +77,15 @@ def setUp(self): (self.inspector_id, self.picture_set_id, create_input_json_str), ) self.created_data = self.cursor.fetchone()[0] - print(self.created_data["organizations"]) + #print(self.created_data["organizations"]) self.created_inspection = Inspection.model_validate(self.created_data) foo = organization.get_organizations_info_label( self.cursor, self.created_data["product"]["label_id"] ) - print("=========") - print(foo) - print("=========") + #print("=========") + #print(foo) + #print("=========") # Store the inspection ID for later use self.inspection_id = self.created_data.get("inspection_id") @@ -118,7 +118,8 @@ def test_update_inspection_with_verified_false(self): self.inspector_id, altered_inspection.model_dump(), ) - Inspection.model_validate(**update_inspection_result) + print(update_inspection_result) + Inspection.model_validate(update_inspection_result) # Verify the inspection record was updated in the database updated_inspection = get_inspection_dict(self.cursor, self.inspection_id) @@ -195,9 +196,9 @@ def test_update_inspection_with_verified_false(self): "SELECT value FROM guaranteed WHERE label_id = %s AND read_name = %s;", (self.created_data["product"]["label_id"], "Total Nitrogen (N)"), ) - print(self.created_data["product"]["label_id"]) + #print(self.created_data["product"]["label_id"]) updated_nitrogen_value = self.cursor.fetchone()[0] - print(updated_nitrogen_value) + #print(updated_nitrogen_value) self.assertEqual( updated_nitrogen_value, new_value,