@@ -1051,7 +1051,7 @@ def test_update_immunization(self,mock_get_permissions):
10511051 "body" : imms ,
10521052 "pathParameters" : {"id" : imms_id },
10531053 }
1054- self .service .update_immunization .return_value = UpdateOutcome .UPDATE , "value doesn't matter"
1054+ self .service .update_immunization .return_value = UpdateOutcome .UPDATE , "value doesn't matter" , 2
10551055 self .service .get_immunization_by_id_all .return_value = {
10561056 "resource" : "new_value" ,
10571057 "Version" : 1 ,
@@ -1066,7 +1066,7 @@ def test_update_immunization(self,mock_get_permissions):
10661066 )
10671067 mock_get_permissions .assert_called_once_with ("Test" )
10681068 self .assertEqual (response ["statusCode" ], 200 )
1069- self .assertTrue ( "body" not in response )
1069+ self .assertEqual ( json . loads ( response [ "body" ]), { "E-Tag" : 2 } )
10701070
10711071 @patch ("fhir_controller.get_supplier_permissions" )
10721072 def test_update_immunization_etag_missing (self , mock_get_supplier_permissions ):
@@ -1247,7 +1247,7 @@ def test_update_deletedat_immunization_with_version(self, mock_get_supplier_perm
12471247 "body" : imms ,
12481248 "pathParameters" : {"id" : imms_id },
12491249 }
1250- self .service .reinstate_immunization .return_value = UpdateOutcome .UPDATE , "value doesn't matter"
1250+ self .service .reinstate_immunization .return_value = UpdateOutcome .UPDATE , {}, 2
12511251 self .service .get_immunization_by_id_all .return_value = {
12521252 "resource" : "new_value" ,
12531253 "Version" : 1 ,
@@ -1261,7 +1261,7 @@ def test_update_deletedat_immunization_with_version(self, mock_get_supplier_perm
12611261 imms_id , json .loads (imms ), 1 , ["COVID19.CRUDS" ], "Test"
12621262 )
12631263 self .assertEqual (response ["statusCode" ], 200 )
1264- self .assertTrue ( "body" not in response )
1264+ self .assertEqual ( json . loads ( response [ "body" ]), { "E-Tag" : 2 } )
12651265
12661266 @patch ("fhir_controller.get_supplier_permissions" )
12671267 def test_update_deletedat_immunization_without_version (self , mock_get_supplier_permissions ):
@@ -1271,11 +1271,11 @@ def test_update_deletedat_immunization_without_version(self, mock_get_supplier_p
12711271 imms = '{"id": "valid-id"}'
12721272 imms_id = "valid-id"
12731273 aws_event = {
1274- "headers" : {"SupplierSystem" : "Test" },
1274+ "headers" : {"SupplierSystem" : "Test" , "E-tag" : 1 },
12751275 "body" : imms ,
12761276 "pathParameters" : {"id" : imms_id },
12771277 }
1278- self .service .reinstate_immunization .return_value = UpdateOutcome .UPDATE , "value doesn't matter"
1278+ self .service .reinstate_immunization .return_value = UpdateOutcome .UPDATE , {}, 2
12791279 self .service .get_immunization_by_id_all .return_value = {
12801280 "resource" : "new_value" ,
12811281 "Version" : 1 ,
@@ -1290,7 +1290,7 @@ def test_update_deletedat_immunization_without_version(self, mock_get_supplier_p
12901290 )
12911291 mock_get_supplier_permissions .assert_called_once_with ("Test" )
12921292 self .assertEqual (response ["statusCode" ], 200 )
1293- self .assertTrue ( "body" not in response )
1293+ self .assertEqual ( json . loads ( response [ "body" ]), { "E-Tag" : 2 } )
12941294
12951295 @patch ("fhir_controller.get_supplier_permissions" )
12961296 def test_update_record_exists (self , mock_get_supplier_permissions ):
@@ -1376,7 +1376,7 @@ def test_validation_superseded_number_to_give_bad_request_for_update_immunizatio
13761376 update_result = {
13771377 "diagnostics" : "Validation errors: contained[?(@.resourceType=='Patient')].identifier[0].value does not exists"
13781378 }
1379- self .service .update_immunization .return_value = None , update_result
1379+ self .service .update_immunization .return_value = None , update_result , 2
13801380 req_imms = '{"id": "valid-id"}'
13811381 path_id = "valid-id"
13821382 aws_event = {
@@ -1396,7 +1396,7 @@ def test_validation_superseded_number_to_give_bad_request_for_update_immunizatio
13961396
13971397 self .assertEqual (response ["statusCode" ], 400 )
13981398 body = json .loads (response ["body" ])
1399- self .assertEqual (body ["resourceType" ], "OperationOutcome" )
1399+ self .assertEqual (body ["resourceType" ], "OperationOutcome" , 2 )
14001400
14011401 @patch ("fhir_controller.get_supplier_permissions" )
14021402 def test_validation_identifier_to_give_bad_request_for_update_immunization (self , mock_get_supplier_permissions ):
0 commit comments