def test_login_logout_save():
    auth, app, user = _get_flask_app()
    auth.session = Session()
    client = app.test_client()

    auth.session.saved = 0

    resp = client.get('/protected/')
    print(resp.data)
    assert auth.session_key not in auth.session
    assert auth.redirect_key in auth.session
    assert auth.session.saved == 1

    data = {
        'login': user.login,
        'password': 'foobar',
        '_csrf_token': auth.get_csrf_token(),
    }
    client.post(auth.url_sign_in, data=data)
    assert auth.session_key in auth.session
    assert auth.session.saved == 4

    data = {
        '_csrf_token': auth.get_csrf_token(),
    }
    client.post(auth.url_sign_out, data=data)
    assert auth.session not in auth.session_key
    assert auth.session.saved == 5
dataset/ETHPy150Open jpscaletti/authcode/tests/test_views.py/test_login_logout_save/swapped operands of `not in`