{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest-flask/issues/40","repository_url":"https://api.github.com/repos/pytest-dev/pytest-flask","labels_url":"https://api.github.com/repos/pytest-dev/pytest-flask/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest-flask/issues/40/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest-flask/issues/40/events","html_url":"https://github.com/pytest-dev/pytest-flask/issues/40","id":128446847,"node_id":"MDU6SXNzdWUxMjg0NDY4NDc=","number":40,"title":"how to testing flask-login?","user":{"login":"tanyewei","id":4241905,"node_id":"MDQ6VXNlcjQyNDE5MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/4241905?v=4","gravatar_id":"","url":"https://api.github.com/users/tanyewei","html_url":"https://github.com/tanyewei","followers_url":"https://api.github.com/users/tanyewei/followers","following_url":"https://api.github.com/users/tanyewei/following{/other_user}","gists_url":"https://api.github.com/users/tanyewei/gists{/gist_id}","starred_url":"https://api.github.com/users/tanyewei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanyewei/subscriptions","organizations_url":"https://api.github.com/users/tanyewei/orgs","repos_url":"https://api.github.com/users/tanyewei/repos","events_url":"https://api.github.com/users/tanyewei/events{/privacy}","received_events_url":"https://api.github.com/users/tanyewei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-01-25T02:38:40Z","updated_at":"2018-12-13T17:55:38Z","closed_at":null,"author_association":"NONE","body":"how to testing flask-login?\n"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest-flask/issues/comments/447061393","html_url":"https://github.com/pytest-dev/pytest-flask/issues/40#issuecomment-447061393","issue_url":"https://api.github.com/repos/pytest-dev/pytest-flask/issues/40","id":447061393,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzA2MTM5Mw==","user":{"login":"doanguyen","id":6127272,"node_id":"MDQ6VXNlcjYxMjcyNzI=","avatar_url":"https://avatars0.githubusercontent.com/u/6127272?v=4","gravatar_id":"","url":"https://api.github.com/users/doanguyen","html_url":"https://github.com/doanguyen","followers_url":"https://api.github.com/users/doanguyen/followers","following_url":"https://api.github.com/users/doanguyen/following{/other_user}","gists_url":"https://api.github.com/users/doanguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/doanguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doanguyen/subscriptions","organizations_url":"https://api.github.com/users/doanguyen/orgs","repos_url":"https://api.github.com/users/doanguyen/repos","events_url":"https://api.github.com/users/doanguyen/events{/privacy}","received_events_url":"https://api.github.com/users/doanguyen/received_events","type":"User","site_admin":false},"created_at":"2018-12-13T17:55:38Z","updated_at":"2018-12-13T17:55:38Z","author_association":"NONE","body":"Hi guys,\r\n\r\nI was also struggling with pytest with authentication by flask login, and here is my working snippet:\r\n\r\n```python\r\n@pytest.fixture()\r\ndef test_with_authenticated_user(app):\r\n    @login_manager.request_loader\r\n    def load_user_from_request(request):\r\n        return User.query.first()\r\n```\r\n\r\n"}}
{"actor":{"display_login":"doanguyen"}}