VED-382: Use configurable disease mappings in backend.#618
VED-382: Use configurable disease mappings in backend.#618
Conversation
…l/immunisation-fhir-api into VED-26-permissions-api merge remote changes
…l/immunisation-fhir-api into VED-26-permissions-api meger remote with the local branch
| self.repository = ImmunizationRepository(table=self.table) | ||
|
|
||
| def tearDown(self): | ||
| self.redis_patcher.stop() |
There was a problem hiding this comment.
Already done in the superclass
| self.patient = {"id": "a-patient-id", "identifier": {"value": "an-identifier"}} | ||
|
|
||
| def tearDown(self): | ||
| patch.stopall() |
There was a problem hiding this comment.
Already done in the superclass
| self.patient = {"id": "a-patient-id"} | ||
|
|
||
| def tearDown(self): | ||
| super().tearDown() |
There was a problem hiding this comment.
Already done in the superclass
| from src.mappings import DiseaseCodes, VaccineTypes | ||
| from src.fhir_repository import ImmunizationRepository | ||
| from src.models.utils.validation_utils import get_vaccine_type | ||
| from mappings import DiseaseCodes, VaccineTypes |
There was a problem hiding this comment.
I thought mappings.py was deleted
|
|
||
| def test_create_patient_with_vaccine_type(self): | ||
| """Patient record should have a sort-key based on vaccine-type""" | ||
| self.mock_redis_client.hget.return_value = VaccineTypes.flu |
There was a problem hiding this comment.
Replace with "FLU" as we're deleting mappings.py
| self.patient = {"id": "a-patient-id", "identifier": {"value": "an-identifier"}} | ||
|
|
||
| def tearDown(self): | ||
| return super().tearDown() |
backend/tests/test_fhir_service.py
Outdated
|
|
||
| def tearDown(self): | ||
| super().tearDown() | ||
| patch.stopall() |
There was a problem hiding this comment.
Already done in the superclass
backend/tests/test_fhir_service.py
Outdated
| self.imms_repo.update_immunization.assert_not_called() | ||
|
|
||
| def test_post_validation_failed(self): | ||
| def test_post_validation_failed_get_by_all(self): |
There was a problem hiding this comment.
This feels like two separate tests (which would make the mocking easier to understand)
There was a problem hiding this comment.
test_post_validation_failed_get_by_all_invalid_target_disease &
test_post_validation_failed_get_by_all_missing_patient_name
backend/tests/test_fhir_service.py
Outdated
| self.pds_service.get_patient_details.assert_not_called() | ||
|
|
||
| def test_post_validation_failed(self): | ||
| def test_post_validation_failed_get(self): |
There was a problem hiding this comment.
This feels like two separate tests. Also deja vu
There was a problem hiding this comment.
test_post_validation_failed_get_invalid_target_disease &
test_post_validation_failed_get_missing_patient_name
backend/tests/test_fhir_service.py
Outdated
| @@ -383,7 +416,7 @@ def test_pre_validation_failed(self): | |||
|
|
|||
| def test_post_validation_failed(self): | |||
There was a problem hiding this comment.
Oh dear these tests aren't very good are they? 😅
There was a problem hiding this comment.
test_post_validation_failed_create_invalid_target_disease &
test_post_validation_failed_create_missing_patient_name
|



Summary
Reviews Required
Review Checklist
ℹ️ This section is to be filled in by the reviewer.