Esempio n. 1
0
 def _test_get_authorization_url(self):
     auth = OAuthHandler(TestAuthentication.CLIENT_ID, TestAuthentication.CLIENT_SECRET,
         'YOUR_CALLBACK')
     self.assertEquals(auth.get_authorization_url(),
         'https://foursquare.com/oauth2/authenticate?redirect_uri=YOUR_CALLBACK' +
         '&response_type=code&client_id=YOUR_CLIENT_ID'
     )
Esempio n. 2
0
 def _test_create_OAuthHandler(self):
     auth = OAuthHandler(TestAuthentication.CLIENT_ID, TestAuthentication.CLIENT_SECRET,
         'YOUR_CALLBACK')
     self.assertEquals(auth._client_id, TestAuthentication.CLIENT_ID)
     self.assertEquals(auth._client_secret, TestAuthentication.CLIENT_SECRET)
     self.assertEquals(auth.callback, 'YOUR_CALLBACK')
Esempio n. 3
0
 def setUp(self):
     self.auth = OAuthHandler(TestAuthentication.CLIENT_ID,
                             TestAuthentication.CLIENT_SECRET,
                             'YOUR_CALLBACK')
     self.auth.set_access_token('YOUR_ACCESS_TOKEN')
Esempio n. 4
0
 def _test_get_access_token(self):
     auth = OAuthHandler(TestAuthentication.CLIENT_ID, TestAuthentication.CLIENT_SECRET,
         'YOUR_CALLBACK')
     code = 'YOUR_CODE'
     self.assert_(auth.get_access_token(code) is not None)