mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
[WIP] added endpoint and dao to create invites for users.
Droped token as later code to send email invite can generate timebased url to send to user. That can then be checked against configurable time threshold for expiry. Therefore no need to store a token.
This commit is contained in:
23
tests/app/dao/test_invited_user_dao.py
Normal file
23
tests/app/dao/test_invited_user_dao.py
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
from app.models import InvitedUser
|
||||
|
||||
from app.dao.invited_user_dao import save_invited_user
|
||||
|
||||
|
||||
def test_create_invited_user(notify_db, notify_db_session, sample_service):
|
||||
assert InvitedUser.query.count() == 0
|
||||
email_address = 'invited_user@service.gov.uk'
|
||||
invite_from = sample_service.users[0]
|
||||
|
||||
data = {
|
||||
'service': sample_service,
|
||||
'email_address': email_address,
|
||||
'from_user': invite_from
|
||||
}
|
||||
|
||||
invited_user = InvitedUser(**data)
|
||||
save_invited_user(invited_user)
|
||||
|
||||
assert InvitedUser.query.count() == 1
|
||||
assert invited_user.email_address == email_address
|
||||
assert invited_user.from_user == invite_from
|
||||
Reference in New Issue
Block a user