def test_create_invited_user(notify_db, notify_db_session, sample_service): assert InvitedUser.query.count() == 0 email_address = '*****@*****.**' invite_from = sample_service.users[0] data = { 'service': sample_service, 'email_address': email_address, 'from_user': invite_from, 'permissions': 'send_messages,manage_service' } 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 permissions = invited_user.get_permissions() assert len(permissions) == 2 assert 'send_messages' in permissions assert 'manage_service' in permissions
def test_create_invited_user(notify_db, notify_db_session, sample_service): assert InvitedUser.query.count() == 0 email_address = "*****@*****.**" invite_from = sample_service.users[0] data = { "service": sample_service, "email_address": email_address, "from_user": invite_from, "permissions": "send_messages,manage_service", "folder_permissions": [], } 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 permissions = invited_user.get_permissions() assert len(permissions) == 2 assert "send_messages" in permissions assert "manage_service" in permissions assert invited_user.folder_permissions == []