Example #1
0
def test_invalid_roles(client):
    # Perform only for roles_required_app
    user007 = current_app.User.query.filter(current_app.User.username=='user007').first()
    if not user007: return

    print("test_invalid_roles")
    um =  current_app.user_manager
    um.enable_username = True

    client.login(username='******', password='******')
    url = url_for('special_page')
    response = client.get_valid_page(url)
    assert response_has_string(response, 'You do not have permission to access')
    client.logout()
Example #2
0
def test_valid_roles(client):
    um =  current_app.user_manager
    User = um.db_adapter.UserClass

    # Perform only for roles_required_app
    user007 = User.query.filter(User.username=='user007').first()
    if not user007: return

    print("test_valid_roles")
    um.enable_username = True

    client.login(username='******', password='******')
    url = url_for('special_page')
    response = client.get_valid_page(url)
    assert not response_has_string(response, 'You must be signed in to access')
    client.logout()
Example #3
0
def test_invalid_roles(client):
    um =  current_app.user_manager
    User = um.db_adapter.UserClass

    # Perform only for roles_required_app
    user007 = User.query.filter(User.username=='user007').first()
    if not user007: return

    print("test_invalid_roles")
    um.enable_username = True

    client.login(username='******', password='******')
    url = url_for('special_page')
    response = client.get_valid_page(url)
    assert response_has_string(response, 'You do not have permission to access')
    client.logout()
def test_invalid_roles(client):
    um = current_app.user_manager
    User = um.db_adapter.UserClass

    # Perform only for roles_required_app
    user007 = User.query.filter(User.username == "user007").first()
    if not user007:
        return

    print("test_invalid_roles")
    um.enable_username = True

    client.login(username="******", password="******")
    url = url_for("special_page")
    response = client.get_valid_page(url)
    assert response_has_string(response, "You do not have permission to access")
    client.logout()