-
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.
Merge pull request #1312 from uktrade/GREATUK-1229-move-market-guides…
…-pipelines-from-staging Disable market guides pre-release workflow
- Loading branch information
Showing
6 changed files
with
25 additions
and
117 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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import re | ||
from datetime import datetime, timedelta | ||
from unittest import mock | ||
|
||
import pytest | ||
from django.conf import settings | ||
from freezegun import freeze_time | ||
|
||
from dataservices import helpers, models | ||
from dataservices.management.commands import helpers as dmch | ||
|
@@ -202,42 +200,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', | ||
|