-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update org cancelled alert to only send to customersuccess@fla…
…gsmith.com (#4522)
- Loading branch information
1 parent
af0369c
commit 18ed5d2
Showing
5 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,9 +253,14 @@ def test_finish_subscription_cancellation(db: None, mocker: MockerFixture) -> No | |
assert organisation4.num_seats == organisation_user_count | ||
|
||
|
||
def test_send_org_subscription_cancelled_alert(db: None, mocker: MockerFixture) -> None: | ||
def test_send_org_subscription_cancelled_alert( | ||
mocker: MockerFixture, settings: SettingsWrapper | ||
) -> None: | ||
# Given | ||
send_mail_mock = mocker.patch("users.models.send_mail") | ||
send_mail_mock = mocker.patch("organisations.tasks.send_mail") | ||
|
||
recipient = "[email protected]" | ||
settings.ORG_SUBSCRIPTION_CANCELLED_ALERT_RECIPIENT_LIST = [recipient] | ||
|
||
# When | ||
send_org_subscription_cancelled_alert( | ||
|
@@ -268,7 +273,7 @@ def test_send_org_subscription_cancelled_alert(db: None, mocker: MockerFixture) | |
subject="Organisation TestCorp has cancelled their subscription", | ||
message="Organisation TestCorp has cancelled their subscription on 2023-02-08 09:12:34", | ||
from_email="[email protected]", | ||
recipient_list=[], | ||
recipient_list=[recipient], | ||
fail_silently=True, | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -622,6 +622,7 @@ def test_when_subscription_is_set_to_non_renewing_then_cancellation_date_set_and | |
subscription: Subscription, | ||
staff_user: FFAdminUser, | ||
staff_client: APIClient, | ||
settings: SettingsWrapper, | ||
) -> None: | ||
# Given | ||
cancellation_date = datetime.now(tz=UTC) + timedelta(days=1) | ||
|
@@ -640,6 +641,8 @@ def test_when_subscription_is_set_to_non_renewing_then_cancellation_date_set_and | |
} | ||
url = reverse("api-v1:chargebee-webhook") | ||
|
||
settings.ORG_SUBSCRIPTION_CANCELLED_ALERT_RECIPIENT_LIST = ["[email protected]"] | ||
|
||
# When | ||
staff_client.post(url, data=json.dumps(data), content_type="application/json") | ||
|
||
|
@@ -658,6 +661,7 @@ def test_when_subscription_is_cancelled_then_cancellation_date_set_and_alert_sen | |
subscription: Subscription, | ||
staff_user: FFAdminUser, | ||
staff_client: APIClient, | ||
settings: SettingsWrapper, | ||
) -> None: | ||
# Given | ||
cancellation_date = datetime.now(tz=UTC) + timedelta(days=1) | ||
|
@@ -676,6 +680,8 @@ def test_when_subscription_is_cancelled_then_cancellation_date_set_and_alert_sen | |
} | ||
url = reverse("api-v1:chargebee-webhook") | ||
|
||
settings.ORG_SUBSCRIPTION_CANCELLED_ALERT_RECIPIENT_LIST = ["[email protected]"] | ||
|
||
# When | ||
staff_client.post(url, data=json.dumps(data), content_type="application/json") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,6 +168,10 @@ | |
{ | ||
"name": "ENABLE_API_USAGE_ALERTING", | ||
"value": "True" | ||
}, | ||
{ | ||
"name": "ORG_SUBSCRIPTION_CANCELLED_ALERT_RECIPIENT_LIST", | ||
"value": "[email protected]" | ||
} | ||
], | ||
"secrets": [ | ||
|