Add page explaining how to send template using API

Would like to test something like this and see how well it works.

Intention of having this page is so:
- template IDs are discoverable (https://www.pivotaltracker.com/story/show/115404593)
- it’s obvious there’s an ‘automated’ way to send messages, as well as the CSV
  way (we’ve seen people oblivious to this in research)
This commit is contained in:
Chris Hill-Scott
2016-03-15 06:53:06 +00:00
parent a647d713a6
commit 8e7b0edc4d
8 changed files with 129 additions and 14 deletions

View File

@@ -90,6 +90,27 @@ def test_send_test_message_to_self(
mock_s3_upload.assert_called_with(ANY, '12345', expected_data, 'eu-west-1')
def test_send_test_message_from_api_page(
app_,
mocker,
api_user_active,
mock_login,
mock_get_service,
mock_get_service_email_template,
mock_s3_upload,
mock_has_permissions
):
with app_.test_request_context():
with app_.test_client() as client:
client.login(api_user_active)
response = client.get(
url_for('main.send_from_api', service_id=12345, template_id=54321),
follow_redirects=True
)
assert response.status_code == 200
assert 'API integration' in response.get_data(as_text=True)
def test_download_example_csv(
app_,
mocker,