-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2067d4
commit 726c4d5
Showing
6 changed files
with
7 additions
and
91 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
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 |
---|---|---|
|
@@ -202,42 +202,6 @@ def test_notify_error_message(mock_notify): | |
assert mock_notify.call_count == 1 | ||
|
||
|
||
@freeze_time('2023-09-13T15:21:10') | ||
@pytest.mark.django_db | ||
@mock.patch('dataservices.management.commands.helpers.notifications_client') | ||
@pytest.mark.parametrize( | ||
"last_release, notification_sent, result", | ||
[ | ||
(datetime.now().strftime('%Y-%m-%dT%H:%M:%S'), None, 1), | ||
( | ||
datetime.now().strftime('%Y-%m-%dT%H:%M:%S'), | ||
(datetime.now() - timedelta(days=10)).strftime('%Y-%m-%dT%H:%M:%S'), | ||
1, | ||
), | ||
( | ||
datetime.now().strftime('%Y-%m-%dT%H:%M:%S'), | ||
(datetime.now() + timedelta(minutes=1)).strftime('%Y-%m-%dT%H:%M:%S'), | ||
0, | ||
), | ||
], | ||
) | ||
def test_send_review_request_message(mock_notify, last_release, notification_sent, result): | ||
data = {'source': {'last_release': last_release}} | ||
data['review_process'] = {} if notification_sent is None else {'notification_sent': notification_sent} | ||
factories.MetadataFactory(view_name='TestView', data=data) | ||
dmch.send_review_request_message('TestView') | ||
mock_notify.call_args = mock.call( | ||
email_address='[email protected]', | ||
template_id=settings.GOVNOTIFY_GREAT_MARKETGUIDES_REVIEW_REQUEST_TEMPLATE_ID, | ||
personalisation={ | ||
'view_name': 'view_name', | ||
'review_url': 'https://great.staging.uktrade.digital/markets/', | ||
'release_date': 'dd/mm/YYYY', | ||
}, | ||
) | ||
assert mock_notify.call_count == result | ||
|
||
|
||
@pytest.mark.django_db | ||
@pytest.mark.parametrize( | ||
'statista_vertical_name, expected_vertical_name', | ||
|