Пример #1
0
def user2(app):
    with app.app_context():
        user = sampledb.models.User(name="Basic User", email="*****@*****.**", type=sampledb.models.UserType.PERSON)
        sampledb.db.session.add(user)
        sampledb.db.session.commit()
        add_email_authentication(user.id, '*****@*****.**', 'abc.123', True)
        # force attribute refresh
        assert user.id is not None
        # Check if authentication-method add to db
        assert len(sampledb.models.Authentication.query.all()) > 0
    return user
Пример #2
0
def user(flask_server):
    user = sampledb.models.User(name="Basic User2", email="*****@*****.**", type=sampledb.models.UserType.PERSON)
    sampledb.db.session.add(user)
    sampledb.db.session.commit()
    add_email_authentication(user.id, '*****@*****.**', 'abc.123', True)
    # force attribute refresh
    assert user.id is not None
    # Check if authentication-method add to db
    with flask_server.app.app_context():
        assert len(sampledb.models.Authentication.query.all()) == 1
    return user