def as_admin(client): """ Login the admin user and log him out afterwards. """ login(client, "*****@*****.**", "testtest") yield logout(client)
def as_prosumer(client): """ Login the default test prosumer and log him out afterwards. """ login(client, "*****@*****.**", "testtest") yield logout(client)
def test_logout(client, as_prosumer_user1): logout_response = logout(client) assert b"Please log in" in logout_response.data
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