Example #1
0
    def test_start_auth(self):
        with patch("flask_app.app.get_oauth_client") as client:
            client().request.return_value = ({'status': '200'}, "oauth_token=123&oauth_token_secret=xyz")
            assert 302 == app.start_auth().status_code

            assert app.session['oauth_token'] == '123'
            assert app.session['oauth_token_secret'] == 'xyz'
Example #2
0
 def test_start_auth_bad_response(self):
     with patch("flask_app.app.get_oauth_client") as client:
         with pytest.raises(Exception):
             client().request.return_value = ({'status': None}, None)
             app.start_auth()