Files
notifications-admin/tests/app/main/views/test_jobs.py
Chris Hill-Scott ba0c9ac6c1 Remove placeholder logs of notifications sent
From the:
- dashboard
- activity page

This info will be confusing for users at the hack day, because it will say
they’ve already sent messages when they first sign up.

This involved changing the table macro to have a nice ‘no rows’ message.
2016-01-19 12:04:18 +00:00

46 lines
1.7 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from flask import url_for
from app.models import User
from tests import create_test_user
def test_should_return_list_of_all_jobs(app_, db_, db_session, service_one):
with app_.test_request_context():
with app_.test_client() as client:
user = User.query.first()
client.login(user)
response = client.get(url_for('main.view_jobs', service_id=101))
assert response.status_code == 200
assert 'You havent sent any notifications yet' in response.get_data(as_text=True)
def test_should_show_page_for_one_job(app_, db_, db_session, service_one):
with app_.test_request_context():
with app_.test_client() as client:
# TODO filename will be part of job metadata not in session
with client.session_transaction() as s:
s[456] = 'dispatch_20151114.csv'
user = User.query.first()
client.login(user)
response = client.get(url_for('main.view_job', service_id=123, job_id=456))
assert response.status_code == 200
assert 'dispatch_20151114.csv' in response.get_data(as_text=True)
assert 'Test message 1' in response.get_data(as_text=True)
def test_should_show_page_for_one_notification(app_, db_, db_session, service_one):
with app_.test_request_context():
with app_.test_client() as client:
user = User.query.first()
client.login(user)
response = client.get(url_for(
'main.view_notification',
service_id=101,
job_id=123,
notification_id=3))
assert response.status_code == 200
assert 'Text message' in response.get_data(as_text=True)
assert '+44 7700 900 522' in response.get_data(as_text=True)