Skip to content

Commit ef2afe1

Browse files
committed
break mock for test_post_validation_failed_get_by_all
1 parent bca9c57 commit ef2afe1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/tests/test_fhir_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def test_pre_validation_failed(self):
140140
self.imms_repo.update_immunization.assert_not_called()
141141

142142
def test_post_validation_failed_get_by_all(self):
143-
self.mock_redis_client.hget.side_effect = [None, 'COVID-19']
143+
self.mock_redis_client.hget.return_value = None
144144
valid_imms = create_covid_19_immunization_dict("an-id", VALID_NHS_NUMBER)
145145

146146
bad_target_disease_imms = deepcopy(valid_imms)
@@ -161,7 +161,9 @@ def test_post_validation_failed_get_by_all(self):
161161
fhir_service.get_immunization_by_id_all("an-id", bad_target_disease_imms)
162162

163163
self.assertEqual(bad_target_disease_msg, error.exception.message)
164+
164165
self.imms_repo.get_immunization_by_id_all.assert_not_called()
166+
self.mock_redis_client.hget.return_value = 'COVID-19'
165167

166168
# Missing patient name (Mandatory field)
167169
with self.assertRaises(CustomValidationError) as error:

0 commit comments

Comments
 (0)