mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
Verify activate and login user with sms and email code
This commit is contained in:
@@ -3,25 +3,23 @@ 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):
|
||||
def test_should_return_list_of_all_jobs(app_, db_, db_session, service_one, active_user, mock_user_loader):
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
user = User.query.first()
|
||||
client.login(user)
|
||||
client.login(active_user)
|
||||
response = client.get(url_for('main.view_jobs', service_id=101))
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'You haven’t 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):
|
||||
def test_should_show_page_for_one_job(app_, db_, db_session, service_one, active_user, mock_user_loader):
|
||||
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)
|
||||
client.login(active_user)
|
||||
response = client.get(url_for('main.view_job', service_id=123, job_id=456))
|
||||
|
||||
assert response.status_code == 200
|
||||
@@ -29,11 +27,10 @@ def test_should_show_page_for_one_job(app_, db_, db_session, service_one):
|
||||
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):
|
||||
def test_should_show_page_for_one_notification(app_, db_, db_session, service_one, active_user, mock_user_loader):
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
user = User.query.first()
|
||||
client.login(user)
|
||||
client.login(active_user)
|
||||
response = client.get(url_for(
|
||||
'main.view_notification',
|
||||
service_id=101,
|
||||
|
||||
Reference in New Issue
Block a user