@@ -108,7 +108,7 @@ def test_process_search_params_checks_patient_identifier_format(self):
108108 self .immunization_target_key : ["RSV" ],
109109 }
110110 )
111- self . assertIsNotNone ( params )
111+
112112
113113 def test_process_search_params_whitelists_immunization_target (self ):
114114 mock_redis_key = "RSV"
@@ -117,14 +117,18 @@ def test_process_search_params_whitelists_immunization_target(self):
117117 process_search_params (
118118 {
119119 self .patient_identifier_key : ["https://fhir.nhs.uk/Id/nhs-number|9000000009" ],
120- self .immunization_target_key : ["not-a-code " ],
120+ self .immunization_target_key : ["FLU" , "COVID-19" , "NOT-A-REAL-VALUE " ],
121121 }
122122 )
123123 self .assertEqual (
124124 str (e .exception ), f"immunization-target must be one or more of the following: { mock_redis_key } " ,
125125 f"Unexpected exception message: { str (e .exception )} "
126126 )
127127
128+
129+ def test_process_search_params_immunization_target (self ):
130+ mock_redis_key = "RSV"
131+ self .mock_redis_client .hkeys .return_value = [mock_redis_key ]
128132 params = process_search_params (
129133 {
130134 self .patient_identifier_key : ["https://fhir.nhs.uk/Id/nhs-number|9000000009" ],
@@ -134,6 +138,7 @@ def test_process_search_params_whitelists_immunization_target(self):
134138
135139 self .assertIsNotNone (params )
136140
141+
137142 def test_search_params_date_from_must_be_before_date_to (self ):
138143 self .mock_redis_client .hkeys .return_value = ["RSV" ]
139144 params = process_search_params (
0 commit comments