Tests added for dao.

This commit is contained in:
Nicholas Staples
2016-01-15 15:15:35 +00:00
parent d42ee85f93
commit 3b1d521c10
39 changed files with 769 additions and 652 deletions
+9 -9
View File
@@ -1,9 +1,9 @@
from tests.app.main import create_test_user
def test_should_return_list_of_all_jobs(notifications_admin, notifications_admin_db, notify_db_session):
with notifications_admin.test_request_context():
with notifications_admin.test_client() as client:
def test_should_return_list_of_all_jobs(app_, db_, db_session):
with app_.test_request_context():
with app_.test_client() as client:
user = create_test_user('active')
client.login(user)
response = client.get('/services/123/jobs')
@@ -13,9 +13,9 @@ def test_should_return_list_of_all_jobs(notifications_admin, notifications_admin
assert 'Final reminder' in response.get_data(as_text=True)
def test_should_show_page_for_one_job(notifications_admin, notifications_admin_db, notify_db_session):
with notifications_admin.test_request_context():
with notifications_admin.test_client() as client:
def test_should_show_page_for_one_job(app_, db_, db_session):
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'
@@ -28,9 +28,9 @@ def test_should_show_page_for_one_job(notifications_admin, notifications_admin_d
assert 'Test message 1' in response.get_data(as_text=True)
def test_should_show_page_for_one_notification(notifications_admin, notifications_admin_db, notify_db_session):
with notifications_admin.test_request_context():
with notifications_admin.test_client() as client:
def test_should_show_page_for_one_notification(app_, db_, db_session):
with app_.test_request_context():
with app_.test_client() as client:
user = create_test_user('active')
client.login(user)
response = client.get('/services/123/jobs/456/notification/3')