예제 #1
0
def test_usr_loader(app):
    with app.app_context():
        eq_(
            loader.usr_loader({
                'typ': 'usr',
                'jti': 't2'
            }).permissions, set([p.test_tokenauth.zig]))
예제 #2
0
def test_usr_loader_disabled(app):
    with app.app_context():
        # disable the token
        session = app.db.session('relengapi')
        tok = tables.Token.query.first()
        tok.disabled = True
        session.commit()
        # no TokenUser results
        eq_(loader.usr_loader({'typ': 'usr', 'jti': 't2'}), None)
예제 #3
0
def test_usr_loader_disabled(app):
    with app.app_context():
        # disable the token
        session = app.db.session('relengapi')
        tok = tables.Token.query.first()
        tok.disabled = True
        session.commit()
        # no TokenUser results
        eq_(loader.usr_loader({'typ': 'usr', 'jti': 't2'}), None)
예제 #4
0
def test_usr_loader(app):
    with app.app_context():
        eq_(loader.usr_loader({'typ': 'usr', 'jti': 't2'}).permissions,
            set([p.test_tokenauth.zig]))