@@ -339,36 +339,6 @@ def test_validate_immunization_identifier_is_empty(self, mock_get_supplier_permi
339339 outcome = json .loads (response ["body" ])
340340 self .assertEqual (outcome ["resourceType" ], "OperationOutcome" )
341341
342- @patch ("fhir_controller.get_supplier_permissions" )
343- def test_validate_immunization_element_is_empty (self , mock_get_supplier_permissions ):
344- """it should return 400 as element is missing"""
345- mock_get_supplier_permissions .return_value = ["COVID19.CRUDS" ]
346- self .service .get_immunization_by_identifier .return_value = {
347- "resourceType" : "OperationOutcome" ,
348- "id" : "f6857e0e-40d0-4e5e-9e2f-463f87d357c6" ,
349- "meta" : {"profile" : ["https://simplifier.net/guide/UKCoreDevelopment2/ProfileUKCore-OperationOutcome" ]},
350- "issue" : [
351- {
352- "severity" : "error" ,
353- "code" : "invalid" ,
354- "details" : {
355- "coding" : [{"system" : "https://fhir.nhs.uk/Codesystem/http-error-codes" , "code" : "INVALID" }]
356- },
357- "diagnostics" : "The provided identifiervalue is either missing or not in the expected format." ,
358- }
359- ],
360- }
361- lambda_event = {
362- "headers" : { "SupplierSystem" : "test" },
363- "queryStringParameters" : {"identifier" : "test|123" , "_elements" : "" },
364- "body" : None ,
365- }
366- response = self .controller .get_immunization_by_identifier (lambda_event )
367-
368- self .assertEqual (self .service .get_immunization_by_identifier .call_count , 0 )
369- self .assertEqual (response ["statusCode" ], 400 )
370- outcome = json .loads (response ["body" ])
371- self .assertEqual (outcome ["resourceType" ], "OperationOutcome" )
372342
373343 @patch ("fhir_controller.get_supplier_permissions" )
374344 def test_validate_immunization_identifier_in_invalid_format (self ,mock_get_supplier_permissions ):
0 commit comments