mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
108536490: Implement LoginManager for the admin app.
Also added csrf error handler, will make the session unauthorized if the csrf token is invalid.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from app.main.dao import users_dao
|
||||
from app.models import Users
|
||||
from app.models import User
|
||||
|
||||
|
||||
def test_render_sign_in_returns_sign_in_template(notifications_admin):
|
||||
@@ -14,12 +14,12 @@ def test_render_sign_in_returns_sign_in_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)
|
||||
user = User(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',
|
||||
|
||||
Reference in New Issue
Block a user