@@ -447,20 +447,6 @@ def test_post_dose_number_positive_int(self):
447447 valid_json_data ["protocolApplied" ][0 ]["doseNumberString" ] = "Dose sequence not recorded"
448448 MandationTests .test_missing_field_accepted (self , dose_number_positive_int_field_location , valid_json_data )
449449
450- # NOTE: THIS TEST IS COMMENTED OUT AS IT IS TESTING A REQUIRED ELEMENT (VALIDATION SHOULD ALWAYS PASS),
451- # AND THE MEANS TO ACCESS THE VALUE HAS NOT BEEN CONFIRMED. DO NOT DELETE THE TEST, IT MAY NEED REINSTATED LATER.
452- # def test_post_vaccine_code_coding_code(self):
453- # """Test that the JSON data is rejected when vaccine_code_coding_code is absent"""
454- # field_location = "vaccineCode.coding[?(@.system=='http://snomed.info/sct')].code"
455- # MandationTests.test_missing_field_accepted(self, field_location)
456-
457- # NOTE: THIS TEST IS COMMENTED OUT AS IT IS TESTING A REQUIRED ELEMENT (VALIDATION SHOULD ALWAYS PASS),
458- # AND THE MEANS TO ACCESS THE VALUE HAS NOT BEEN CONFIRMED. DO NOT DELETE THE TEST, IT MAY NEED REINSTATED LATER.
459- # def test_post_vaccine_code_coding_display(self):
460- # """Test that the JSON data is accepted when vaccine_code_coding_display is absent"""
461- # field_location = "vaccineCode.coding[?(@.system=='http://snomed.info/sct')].display"
462- # MandationTests.test_missing_field_accepted(self, field_location)
463-
464450 def test_post_manufacturer_display (self ):
465451 """
466452 Test that present or absent manufacturer_display is accepted or rejected
@@ -504,35 +490,6 @@ def test_post_expiration_date(self):
504490 for vaccine_type in self .all_vaccine_types :
505491 MandationTests .test_missing_field_accepted (self , field_location , self .completed_json_data [vaccine_type ])
506492
507- # NOTE: THIS TEST IS COMMENTED OUT AS IT IS TESTING A REQUIRED ELEMENT (VALIDATION SHOULD ALWAYS PASS),
508- # AND THE MEANS TO ACCESS THE VALUE HAS NOT BEEN CONFIRMED. DO NOT DELETE THE TEST, IT MAY NEED REINSTATED LATER.
509- # def test_post_site_coding_code(self):
510- # """Test that the JSON data is accepted when site_coding_code is absent"""
511- # MandationTests.test_missing_field_accepted(self, "site.coding[?(@.system=='http://snomed.info/sct')].code")
512-
513- # NOTE: THIS TEST IS COMMENTED OUT AS IT IS TESTING A REQUIRED ELEMENT (VALIDATION SHOULD ALWAYS PASS),
514- # AND THE MEANS TO ACCESS THE VALUE HAS NOT BEEN CONFIRMED. DO NOT DELETE THE TEST, IT MAY NEED REINSTATED LATER.
515- # def test_post_site_coding_display(self):
516- # """Test that the JSON data is accepted when site_coding_display is absent"""
517- # MandationTests.test_missing_field_accepted(self, "site.coding[?(@.system=='http://snomed.info/sct')].display")
518-
519- # NOTE: THIS TEST IS COMMENTED OUT AS IT IS TESTING A REQUIRED ELEMENT (VALIDATION SHOULD ALWAYS PASS),
520- # AND THE MEANS TO ACCESS THE VALUE HAS NOT BEEN CONFIRMED. DO NOT DELETE THE TEST, IT MAY NEED REINSTATED LATER.
521- # def test_post_route_coding_code(self):
522- # """
523- # Test that present or absent route_coding_code is accepted or rejected
524- # as appropriate dependent on other fields
525- # """
526- # field_location = "route.coding[?(@.system=='http://snomed.info/sct')].code"
527- # for vaccine_type in self.all_vaccine_types:
528- # MandationTests.test_missing_field_accepted(self, field_location, self.completed_json_data[vaccine_type])
529-
530- # NOTE: THIS TEST IS COMMENTED OUT AS IT IS TESTING A REQUIRED ELEMENT (VALIDATION SHOULD ALWAYS PASS),
531- # AND THE MEANS TO ACCESS THE VALUE HAS NOT BEEN CONFIRMED. DO NOT DELETE THE TEST, IT MAY NEED REINSTATED LATER.
532- # def test_post_route_coding_display(self):
533- # """Test that the JSON data is accepted when route_coding_display is absent"""
534- # MandationTests.test_missing_field_accepted(self, "route.coding[?(@.system=='http://snomed.info/sct')].display")
535-
536493 def test_post_dose_quantity_value (self ):
537494 """
538495 Test that present or absent dose_quantity_value is accepted or rejected as appropriate dependent on other fields
@@ -572,13 +529,6 @@ def test_post_dose_quantity_unit(self):
572529 self .mock_redis_getter .return_value = self .mock_redis
573530 MandationTests .test_missing_field_accepted (self , "doseQuantity.unit" )
574531
575- # NOTE: THIS TEST IS COMMENTED OUT AS IT IS TESTING A REQUIRED ELEMENT (VALIDATION SHOULD ALWAYS PASS),
576- # AND THE MEANS TO ACCESS THE VALUE HAS NOT BEEN CONFIRMED. DO NOT DELETE THE TEST, IT MAY NEED REINSTATED LATER.
577- # def test_post_reason_code_coding_code(self):
578- # """Test that the JSON data is accepted when reason_code_coding_code is absent"""
579- # for index in range(len(self.completed_json_data["COVID"]["reasonCode"])):
580- # MandationTests.test_missing_field_accepted(self, f"reasonCode[{index}].coding[0].code")
581-
582532 def test_post_organization_identifier_system (self ):
583533 """Test that the JSON data is rejected if it does not contain organization_identifier_system"""
584534 self .mock_redis .hget .side_effect = None
@@ -703,3 +653,41 @@ def test_post_no_snomed_code(self):
703653
704654 actual_error_message = str (cm .exception )
705655 self .assertIn (expected_error_message , actual_error_message )
656+
657+ # Note: these tests are commented out as they are testing required elements (validation should always pass),
658+ # and the means to access the values have not been confirmed. Do not delete the tests, they may need reinstating later.
659+ # def test_post_vaccine_code_coding_code(self):
660+ # """Test that the JSON data is rejected when vaccine_code_coding_code is absent"""
661+ # field_location = "vaccineCode.coding[?(@.system=='http://snomed.info/sct')].code"
662+ # MandationTests.test_missing_field_accepted(self, field_location)
663+ #
664+ # def test_post_vaccine_code_coding_display(self):
665+ # """Test that the JSON data is accepted when vaccine_code_coding_display is absent"""
666+ # field_location = "vaccineCode.coding[?(@.system=='http://snomed.info/sct')].display"
667+ # MandationTests.test_missing_field_accepted(self, field_location)
668+ #
669+ # def test_post_site_coding_code(self):
670+ # """Test that the JSON data is accepted when site_coding_code is absent"""
671+ # MandationTests.test_missing_field_accepted(self, "site.coding[?(@.system=='http://snomed.info/sct')].code")
672+ #
673+ # def test_post_site_coding_display(self):
674+ # """Test that the JSON data is accepted when site_coding_display is absent"""
675+ # MandationTests.test_missing_field_accepted(self, "site.coding[?(@.system=='http://snomed.info/sct')].display")
676+ #
677+ # def test_post_route_coding_code(self):
678+ # """
679+ # Test that present or absent route_coding_code is accepted or rejected
680+ # as appropriate dependent on other fields
681+ # """
682+ # field_location = "route.coding[?(@.system=='http://snomed.info/sct')].code"
683+ # for vaccine_type in self.all_vaccine_types:
684+ # MandationTests.test_missing_field_accepted(self, field_location, self.completed_json_data[vaccine_type])
685+ #
686+ # def test_post_route_coding_display(self):
687+ # """Test that the JSON data is accepted when route_coding_display is absent"""
688+ # MandationTests.test_missing_field_accepted(self, "route.coding[?(@.system=='http://snomed.info/sct')].display")
689+ #
690+ # def test_post_reason_code_coding_code(self):
691+ # """Test that the JSON data is accepted when reason_code_coding_code is absent"""
692+ # for index in range(len(self.completed_json_data["COVID"]["reasonCode"])):
693+ # MandationTests.test_missing_field_accepted(self, f"reasonCode[{index}].coding[0].code")
0 commit comments