Skip to content

Commit

Permalink
remove unnecessary format string lines from env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
leohemsted committed Jan 2, 2025
1 parent 729a526 commit 6e6427d
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions app/functional_tests_fixtures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,43 +290,44 @@ def _create_db_objects(
_create_inbound_sms(service, 3)

return {
"FUNCTIONAL_TESTS_API_HOST": f"{current_app.config['API_HOST_NAME']}",
"FUNCTIONAL_TESTS_ADMIN_HOST": f"{current_app.config['ADMIN_BASE_URL']}",
"ENVIRONMENT": f"{current_app.config['NOTIFY_ENVIRONMENT']}",
"FUNCTIONAL_TEST_EMAIL": f"{func_test_user.email_address}",
"FUNCTIONAL_TEST_PASSWORD": f"{functional_test_password}",
"FUNCTIONAL_TESTS_API_HOST": current_app.config["API_HOST_NAME"],
"FUNCTIONAL_TESTS_ADMIN_HOST": current_app.config["ADMIN_BASE_URL"],
"ENVIRONMENT": current_app.config["NOTIFY_ENVIRONMENT"],
"FUNCTIONAL_TEST_EMAIL": func_test_user.email_address,
"FUNCTIONAL_TEST_PASSWORD": functional_test_password,
"TEST_NUMBER": "07700900001",
"NOTIFY_SERVICE_API_KEY": f"{function_tests_govuk_key_name}-{govuk_service_id}-{api_key_notify.secret}",
"FUNCTIONAL_TESTS_SERVICE_EMAIL": f"{service_admin_user.email_address}",
"FUNCTIONAL_TESTS_SERVICE_EMAIL_AUTH_ACCOUNT": f"{email_auth_user.email_address}",
"FUNCTIONAL_TESTS_SERVICE_EMAIL_PASSWORD": f"{functional_test_password}",
"FUNCTIONAL_TESTS_SERVICE_EMAIL": service_admin_user.email_address,
"FUNCTIONAL_TESTS_SERVICE_EMAIL_AUTH_ACCOUNT": email_auth_user.email_address,
"FUNCTIONAL_TESTS_SERVICE_EMAIL_PASSWORD": functional_test_password,
"FUNCTIONAL_TESTS_SERVICE_NUMBER": "07700900501",
"FUNCTIONAL_TESTS_SERVICE_ID": f"{service.id}",
"FUNCTIONAL_TESTS_SERVICE_NAME": f"{service.name}",
"FUNCTIONAL_TESTS_ORGANISATION_ID": f"{org.id}",
"FUNCTIONAL_TESTS_SERVICE_ID": service.id,
"FUNCTIONAL_TESTS_SERVICE_NAME": service.name,
"FUNCTIONAL_TESTS_ORGANISATION_ID": org.id,
"FUNCTIONAL_TESTS_SERVICE_API_KEY": f"{function_tests_live_key_name}-{service.id}-{api_key_live_key.secret}",
"FUNCTIONAL_TESTS_SERVICE_API_TEST_KEY": f"{function_tests_test_key_name}-{service.id}-{api_key_test_key.secret}", # noqa: E501
"FUNCTIONAL_TESTS_API_AUTH_SECRET": f"{current_app.config['INTERNAL_CLIENT_API_KEYS']['notify-functional-tests'][0]}", # noqa: E501
"FUNCTIONAL_TESTS_API_AUTH_SECRET": current_app.config["INTERNAL_CLIENT_API_KEYS"]["notify-functional-tests"][
0
],
"FUNCTIONAL_TESTS_SERVICE_EMAIL_REPLY_TO": f"{test_email_username}+{environment}-reply-to@{email_domain}",
"FUNCTIONAL_TESTS_SERVICE_EMAIL_REPLY_TO_ID": f"{email_reply_to.id}",
"FUNCTIONAL_TESTS_SERVICE_SMS_SENDER_ID": f"{sms_sender.id}",
"FUNCTIONAL_TESTS_SERVICE_EMAIL_REPLY_TO_ID": email_reply_to.id,
"FUNCTIONAL_TESTS_SERVICE_SMS_SENDER_ID": sms_sender.id,
"FUNCTIONAL_TESTS_SERVICE_INBOUND_NUMBER": "07700900500",
"FUNCTIONAL_TEST_SMS_TEMPLATE_ID": f"{template2_id}",
"FUNCTIONAL_TEST_EMAIL_TEMPLATE_ID": f"{template1_id}",
"FUNCTIONAL_TEST_LETTER_TEMPLATE_ID": f"{template3_id}",
"MMG_INBOUND_SMS_USERNAME": f"{current_app.config['MMG_INBOUND_SMS_USERNAME'][0]}",
"MMG_INBOUND_SMS_AUTH": f"{current_app.config['MMG_INBOUND_SMS_AUTH'][0]}",
"REQUEST_BIN_API_TOKEN": f"{request_bin_api_token}",
# API client integration test environment
"SERVICE_ID": f"{service.id}",
"FUNCTIONAL_TEST_EMAIL": f"{func_test_user.email_address}",
"FUNCTIONAL_TEST_SMS_TEMPLATE_ID": sms_template.id,
"FUNCTIONAL_TEST_EMAIL_TEMPLATE_ID": email_template.id,
"FUNCTIONAL_TEST_LETTER_TEMPLATE_ID": letter_template.id,
"MMG_INBOUND_SMS_USERNAME": current_app.config["MMG_INBOUND_SMS_USERNAME"][0],
"MMG_INBOUND_SMS_AUTH": current_app.config["MMG_INBOUND_SMS_AUTH"][0],
"REQUEST_BIN_API_TOKEN": request_bin_api_token,
# API client integration test environment variables
"SERVICE_ID": service.id,
"FUNCTIONAL_TEST_NUMBER": "07700900500",
"EMAIL_TEMPLATE_ID": f"{api_client_integration_test_email_template.id}",
"SMS_TEMPLATE_ID": f"{api_client_integration_test_sms_template.id}",
"LETTER_TEMPLATE_ID": f"{api_client_integration_test_letter_template.id}",
"EMAIL_REPLY_TO_ID": f"{email_reply_to.id}",
"SMS_SENDER_ID": f"{sms_sender.id}",
"NOTIFY_API_URL": f"{current_app.config['API_HOST_NAME']}",
"EMAIL_TEMPLATE_ID": api_client_integration_test_email_template.id,
"SMS_TEMPLATE_ID": api_client_integration_test_sms_template.id,
"LETTER_TEMPLATE_ID": api_client_integration_test_letter_template.id,
"EMAIL_REPLY_TO_ID": email_reply_to.id,
"SMS_SENDER_ID": sms_sender.id,
"NOTIFY_API_URL": current_app.config["API_HOST_NAME"],
"API_KEY": f"{function_tests_test_key_name}-{service.id}-{api_key_test_key.secret}",
"API_SENDING_KEY": f"{function_tests_live_key_name}-{service.id}-{api_key_live_key.secret}",
"INBOUND_SMS_QUERY_KEY": f"{function_tests_test_key_name}-{service.id}-{api_key_test_key.secret}",
Expand Down

0 comments on commit 6e6427d

Please sign in to comment.