Permalink
Browse files

Add OAuth2 test for ensuring get_authorize_url raises when no authori…

…ze_url has been supplied
  • Loading branch information...
1 parent 12b86c1 commit 00f4e59d52fb38e3e34eca24bebd8c19d1f7824f @kiall kiall committed Aug 3, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/test_service.py
View
10 tests/test_service.py
@@ -143,6 +143,16 @@ def test_get_authorize_url(self):
'http://example.com/authorize?response_type=code&client_id=123'
self.assertEqual(expected_url, authorize_url)
+ def test_get_authorize_url_raises(self):
+ service = OAuth2Service(
+ 'example',
+ client_id='123',
+ client_secret='456',
+ access_token_url='http://example.com/access_token')
+
+ with self.assertRaises(ValueError):
+ authorize_url = service.get_authorize_url()
+
def test_get_authorize_url_response_type(self):
authorize_url = self.service.get_authorize_url(response_type='token')
expected_url = \

0 comments on commit 00f4e59

Please sign in to comment.