Пример #1
0
def as_admin(client):
    """
    Login the admin user and log him out afterwards.
    """
    login(client, "*****@*****.**", "testtest")
    yield
    logout(client)
Пример #2
0
def as_prosumer(client):
    """
    Login the default test prosumer and log him out afterwards.
    """
    login(client, "*****@*****.**", "testtest")
    yield
    logout(client)
Пример #3
0
def test_logout(client, as_prosumer_user1):
    logout_response = logout(client)
    assert b"Please log in" in logout_response.data
Пример #4
0
def test_dashboard_responds_only_for_logged_in_users(client,
                                                     as_prosumer_user1):
    logout(client)
    dashboard = client.get(url_for("flexmeasures_ui.dashboard_view"),
                           follow_redirects=True)
    assert b"Please log in" in dashboard.data