mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 22:53:12 -04:00
Add data to copy into beta partners spreadsheet
Currently we keep track of live services in the ‘beta partners’ spreadsheet: https://docs.google.com/spreadsheets/d/1JYhE5sJaOJUVMPPDenO2eKqElC75Rygxb1_2mpRKy98/edit#gid=503930061 Every time a service goes live we need to enter some data into the spreadsheet about that service. Most of that data is copied from the request to go live ticket. This commit adds a line to the ticket with all the data needed by the spreadsheet. It’s in the same order as in the spreadsheet, and it’s tab-delimted so it should paste right on in there.
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
import pytz
|
||||||
from flask import (
|
from flask import (
|
||||||
abort,
|
abort,
|
||||||
current_app,
|
current_app,
|
||||||
@@ -222,6 +225,16 @@ def submit_request_to_go_live(service_id):
|
|||||||
'\nChannel: {}\nStart date: {}\nStart volume: {}'
|
'\nChannel: {}\nStart date: {}\nStart volume: {}'
|
||||||
'\nPeak volume: {}'
|
'\nPeak volume: {}'
|
||||||
'\nFeatures: {}'
|
'\nFeatures: {}'
|
||||||
|
'\n'
|
||||||
|
'\n---'
|
||||||
|
'\n'
|
||||||
|
'{service_id}\t'
|
||||||
|
'{organisation}\t'
|
||||||
|
'{service_name}\t'
|
||||||
|
'{user_name}\t'
|
||||||
|
'{user_email}\t'
|
||||||
|
'-\t'
|
||||||
|
'{date}'
|
||||||
).format(
|
).format(
|
||||||
current_service.name,
|
current_service.name,
|
||||||
url_for('main.service_dashboard', service_id=current_service.id, _external=True),
|
url_for('main.service_dashboard', service_id=current_service.id, _external=True),
|
||||||
@@ -239,7 +252,13 @@ def submit_request_to_go_live(service_id):
|
|||||||
'one off' if form.method_one_off.data else None,
|
'one off' if form.method_one_off.data else None,
|
||||||
'file upload' if form.method_upload.data else None,
|
'file upload' if form.method_upload.data else None,
|
||||||
'API' if form.method_api.data else None,
|
'API' if form.method_api.data else None,
|
||||||
)), before_each='', after_each='')
|
)), before_each='', after_each=''),
|
||||||
|
service_id=current_service.id,
|
||||||
|
organisation=AgreementInfo.from_current_user().owner,
|
||||||
|
service_name=current_service.name,
|
||||||
|
user_name=current_user.name,
|
||||||
|
user_email=current_user.email_address,
|
||||||
|
date=datetime.now(tz=pytz.timezone('Europe/London')).strftime('%d/%m/%Y'),
|
||||||
),
|
),
|
||||||
ticket_type=zendesk_client.TYPE_QUESTION,
|
ticket_type=zendesk_client.TYPE_QUESTION,
|
||||||
user_email=current_user.email_address,
|
user_email=current_user.email_address,
|
||||||
|
|||||||
@@ -708,6 +708,7 @@ def test_should_show_request_to_go_live(
|
|||||||
) == label
|
) == label
|
||||||
|
|
||||||
|
|
||||||
|
@freeze_time("2012-12-21")
|
||||||
def test_should_redirect_after_request_to_go_live(
|
def test_should_redirect_after_request_to_go_live(
|
||||||
client_request,
|
client_request,
|
||||||
mocker,
|
mocker,
|
||||||
@@ -741,16 +742,22 @@ def test_should_redirect_after_request_to_go_live(
|
|||||||
user_name=active_user_with_permissions.name,
|
user_name=active_user_with_permissions.name,
|
||||||
user_email=active_user_with_permissions.email_address
|
user_email=active_user_with_permissions.email_address
|
||||||
)
|
)
|
||||||
|
assert mock_post.call_args[1]['message'] == (
|
||||||
returned_message = mock_post.call_args[1]['message']
|
'Service: service one\n'
|
||||||
assert 'Service: service one' in returned_message
|
'http://localhost/services/{}\n'
|
||||||
assert 'Organisation type: central' in returned_message
|
'\n'
|
||||||
assert 'Agreement signed: Can’t tell' in returned_message
|
'---\n'
|
||||||
assert 'Channel: email and text messages' in returned_message
|
'Organisation type: central\n'
|
||||||
assert 'Start date: 01/01/2017' in returned_message
|
'Agreement signed: Can’t tell (domain is user.gov.uk)\n'
|
||||||
assert 'Start volume: 100,000' in returned_message
|
'Channel: email and text messages\n'
|
||||||
assert 'Peak volume: 2,000,000' in returned_message
|
'Start date: 01/01/2017\n'
|
||||||
assert 'Features: one off, file upload and API' in returned_message
|
'Start volume: 100,000\n'
|
||||||
|
'Peak volume: 2,000,000\n'
|
||||||
|
'Features: one off, file upload and API\n'
|
||||||
|
'\n'
|
||||||
|
'---\n'
|
||||||
|
'{}\tNone\tservice one\tTest User\ttest@user.gov.uk\t-\t21/12/2012'
|
||||||
|
).format(SERVICE_ONE_ID, SERVICE_ONE_ID)
|
||||||
|
|
||||||
assert normalize_spaces(page.select_one('.banner-default').text) == (
|
assert normalize_spaces(page.select_one('.banner-default').text) == (
|
||||||
'Thanks for your request to go live. We’ll get back to you within one working day.'
|
'Thanks for your request to go live. We’ll get back to you within one working day.'
|
||||||
|
|||||||
Reference in New Issue
Block a user