Skip to content

Commit 0233b38

Browse files
committed
comments
1 parent 148880e commit 0233b38

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

backend/tests/test_parameter_parser.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,17 @@ def test_process_search_params_checks_patient_identifier_format(self):
111111
self.assertIsNotNone(params)
112112

113113
def test_process_search_params_whitelists_immunization_target(self):
114-
self.mock_redis_client.hkeys.return_value = ["RSV"]
114+
mock_redis_key = "RSV"
115+
self.mock_redis_client.hkeys.return_value = [mock_redis_key]
115116
with self.assertRaises(ParameterException) as e:
116117
process_search_params(
117118
{
118119
self.patient_identifier_key: ["https://fhir.nhs.uk/Id/nhs-number|9000000009"],
119120
self.immunization_target_key: ["not-a-code"],
120121
}
121122
)
122-
self.assertTrue(
123-
str(e.exception).startswith("immunization-target must be one or more of the following:"),
123+
self.assertEqual(
124+
str(e.exception), f"immunization-target must be one or more of the following: {mock_redis_key}",
124125
f"Unexpected exception message: {str(e.exception)}"
125126
)
126127

backend/tests/test_update_imms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def setUp(self):
1717
self.mock_logger_info = self.logger_info_patcher.start()
1818

1919
def tearDown(self):
20-
self.logger_exception_patcher.stop()
20+
patch.stopall()
2121

2222

2323
def test_update_immunization(self):

0 commit comments

Comments
 (0)