Skip to content

Commit

Permalink
Merge pull request #3661 from alphagov/live-to-prod
Browse files Browse the repository at this point in the history
Rename live to prod
  • Loading branch information
leohemsted authored Dec 9, 2022
2 parents 8ab694d + 5404c1c commit 6b59d2a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
7 changes: 3 additions & 4 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ class Staging(Config):
CHECK_PROXY_HEADER = True


class Live(Config):
class Production(Config):
NOTIFY_EMAIL_DOMAIN = "notifications.service.gov.uk"
NOTIFY_ENVIRONMENT = "live"
NOTIFY_ENVIRONMENT = "production"
CSV_UPLOAD_BUCKET_NAME = "live-notifications-csv-upload"
CONTACT_LIST_BUCKET_NAME = "production-contact-list"
TEST_LETTERS_BUCKET_NAME = "production-test-letters"
Expand Down Expand Up @@ -573,8 +573,7 @@ class Sandbox(CloudFoundryConfig):
configs = {
"development": Development,
"test": Test,
"live": Live,
"production": Live,
"production": Production,
"staging": Staging,
"preview": Preview,
"sandbox": Sandbox,
Expand Down
2 changes: 1 addition & 1 deletion app/notify_api_flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class NotifyApiFlaskApp(Flask):
@property
def is_prod(self):
return self.config["NOTIFY_ENVIRONMENT"] in {"live", "production"}
return self.config["NOTIFY_ENVIRONMENT"] == "production"

@property
def is_test(self):
Expand Down
8 changes: 4 additions & 4 deletions tests/app/broadcast_message/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def test_update_broadcast_message_status_creates_zendesk_ticket(mocker, notify_a
autospec=True,
)

with set_config(notify_api, "NOTIFY_ENVIRONMENT", "live"):
with set_config(notify_api, "NOTIFY_ENVIRONMENT", "production"):
update_broadcast_message_status(broadcast_message, BroadcastStatusType.BROADCASTING, approver)

mock_send_ticket_to_zendesk.assert_called_once()
Expand All @@ -354,7 +354,7 @@ def test_create_p1_zendesk_alert(sample_broadcast_service, mocker, notify_api):
autospec=True,
)

with set_config(notify_api, "NOTIFY_ENVIRONMENT", "live"):
with set_config(notify_api, "NOTIFY_ENVIRONMENT", "production"):
_create_p1_zendesk_alert(broadcast_message)

ticket = mock_send_ticket_to_zendesk.call_args_list[0].args[0]
Expand All @@ -378,7 +378,7 @@ def test_create_p1_zendesk_alert_doesnt_alert_when_cancelling(mocker, notify_api
autospec=True,
)

with set_config(notify_api, "NOTIFY_ENVIRONMENT", "live"):
with set_config(notify_api, "NOTIFY_ENVIRONMENT", "production"):
_create_p1_zendesk_alert(broadcast_message)

mock_send_ticket_to_zendesk.assert_not_called()
Expand Down Expand Up @@ -417,7 +417,7 @@ def test_create_p1_zendesk_alert_doesnt_alert_for_stubbed_messages(mocker, notif
autospec=True,
)

with set_config(notify_api, "NOTIFY_ENVIRONMENT", "live"):
with set_config(notify_api, "NOTIFY_ENVIRONMENT", "production"):
_create_p1_zendesk_alert(broadcast_message)

mock_send_ticket_to_zendesk.assert_not_called()
2 changes: 1 addition & 1 deletion tests/app/celery/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ def test_save_sms_uses_non_default_sms_sender_reply_to_text_if_provided(mocker,
assert persisted_notification.reply_to_text == "new-sender"


@pytest.mark.parametrize("env", ["staging", "live"])
@pytest.mark.parametrize("env", ["staging", "production"])
def test_save_letter_sets_delivered_letters_as_pdf_permission_in_research_mode_in_staging_live(
notify_api, mocker, notify_db_session, sample_letter_job, env
):
Expand Down
8 changes: 1 addition & 7 deletions tests/app/v2/notifications/test_post_letter_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,7 @@ def test_post_letter_notification_throws_error_for_bad_address(
assert error_json["errors"] == [{"error": "ValidationError", "message": expected_error}]


@pytest.mark.parametrize(
"env",
[
"staging",
"live",
],
)
@pytest.mark.parametrize("env", ["staging", "production"])
def test_post_letter_notification_with_test_key_creates_pdf_and_sets_status_to_delivered(
notify_api, api_client_request, sample_letter_template, mocker, env
):
Expand Down

0 comments on commit 6b59d2a

Please sign in to comment.