Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Calling two() method in flask util test. #313

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/test_flask_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,15 @@ def two():
self.assertTrue('include_granted_scopes' in q)
self.assertEqual(q['scope'][0], 'email one two three')

# Actually call two() without a redirect.
credentials2 = self._generate_credentials(scopes=['two', 'three'])
with self.app.test_client() as c:
with c.session_transaction() as session:
session['google_oauth2_credentials'] = credentials2.to_json()

rv = c.get('/two')
self.assertEqual(rv.status_code, httplib.OK)

def test_refresh(self):
with self.app.test_request_context():
with mock.patch('flask.session'):
Expand Down