Example #1
0
 def make_new_user_and_token(name='francine', tier='superadmin'):
     user = User()
     user.create_admin_auth(email=name + '@withsempo.com',
                            password='******',
                            tier=tier)
     user.organisations.append(create_organisation)
     user.default_organisation = create_organisation
     user.is_activated = True
     user.set_TFA_secret()
     user.TFA_enabled = True
     db.session.commit()
     return user, get_complete_auth_token(user)
Example #2
0
def new_sempo_admin_user(test_client, init_database, create_organisation):
    from server.models.user import User
    user = User()
    user.create_admin_auth(email='*****@*****.**', password='******', tier='sempoadmin')
    user.organisations.append(create_organisation)
    user.default_organisation = create_organisation

    db.session.add(user)

    # Commit so it gets an ID
    db.session.commit()

    return user