mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
108536490: Adding the login manager and csrf token.
Still need to figure out how to override the load_user method, currently it is not working.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from app.main.dao import users_dao
|
||||
from app.models import Users
|
||||
|
||||
|
||||
def test_render_sign_in_returns_sign_in_template(notifications_admin):
|
||||
@@ -9,9 +13,24 @@ def test_render_sign_in_returns_sign_in_template(notifications_admin):
|
||||
assert 'Forgotten password?' in response.get_data(as_text=True)
|
||||
|
||||
|
||||
def test_process_sign_in_return_2fa_template(notifications_admin):
|
||||
def test_process_sign_in_return_2fa_template(notifications_admin, notifications_admin_db):
|
||||
user = Users(email_address='valid@example.gov.uk',
|
||||
password='val1dPassw0rd!',
|
||||
mobile_number='+441234123123',
|
||||
name='valid',
|
||||
created_at=datetime.now(),
|
||||
role_id=1)
|
||||
users_dao.insert_user(user)
|
||||
response = notifications_admin.test_client().post('/sign-in',
|
||||
data={'email_address': 'valid@example.gov.uk',
|
||||
'password': 'val1dPassw0rd!'})
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/two-factor'
|
||||
|
||||
|
||||
def test_temp_create_user(notifications_admin, notifications_admin_db):
|
||||
response = notifications_admin.test_client().post('/temp-create-users',
|
||||
data={'email_address': 'testing@example.gov.uk',
|
||||
'password': 'val1dPassw0rd!'})
|
||||
|
||||
assert response.status_code == 302
|
||||
|
||||
Reference in New Issue
Block a user