The code base is littered with TODO comments. This TODO asks to pass simulated as a parameter to
process_sms_or_email_notification or to mock the undesired side-effects in test code, rather than using a predetermined list of e-mail addresses defined or simulation
[ ] Ticket is understood, and QA has been contacted (if the ticket has a QA label).
User Story(ies)
As a VANotify
I want to remove tech debt
So that to have a maintainable codebase
Additional Info and Resources
TODO: This value is computed using a predetermined list of e-mail addresses defined to be for simulation. A better approach might be to pass "simulated" as a parameter to process_sms_or_email_notification or to mock the undesired side-effects in test code.
def process_sms_or_email_notification(*, form, notification_type, api_key, template, service, reply_to_text=None):
form_send_to = form["email_address" if (notification_type == EMAIL_TYPE) else "phone_number"]
send_to = validate_and_format_recipient(
send_to=form_send_to,
key_type=api_key.key_type,
service=service,
notification_type=notification_type
)
# Do not persist or send notification to the queue if it is a simulated recipient.
#
# TODO (tech debt) - This value is computed using a predetermined list of e-mail addresses defined
# to be for simulation. A better approach might be to pass "simulated" as a parameter to
# process_sms_or_email_notification or to mock the undesired side-effects in test code.
simulated: bool = simulated_recipient(send_to, notification_type)
See @EvanParish for more details.
Engineering Checklist
[ ] Determine whether to pass "simulated" as a parameter to process_sms_or_email_notification or to mock the undesired side-effects in test code.
User Story - Business Need
The code base is littered with TODO comments. This TODO asks to pass
simulated
as a parameter toprocess_sms_or_email_notification
or to mock the undesired side-effects in test code, rather than using a predetermined list of e-mail addresses defined or simulationUser Story(ies)
As a VANotify I want to remove tech debt So that to have a maintainable codebase
Additional Info and Resources
TODO: This value is computed using a predetermined list of e-mail addresses defined to be for simulation. A better approach might be to pass "simulated" as a parameter to process_sms_or_email_notification or to mock the undesired side-effects in test code.
See @EvanParish for more details.
Engineering Checklist
Acceptance Criteria