Skip to content

Instantly share code, notes, and snippets.

@memee
Created April 29, 2012 11:48
Show Gist options
  • Save memee/2549741 to your computer and use it in GitHub Desktop.
Save memee/2549741 to your computer and use it in GitHub Desktop.
Mock handle_oauth_redirection
class OauthTest(TestCase):
from gsmcenter.oauth.handlers.facebook import OauthHandler
@patch('gsmcenter.oauth.handlers.facebook.OauthHandler')
def test_handle_oauth_authentication_error(self, MockClass):
"""
test if user is being informed when facebook response returned error
"""
data = {
'code': 'AQD5H5TrUYUBveCzFECkQFDDBejeJeh4LqDSpQU4nQIY8-gmE3ggp7gVZ67zsvbSr1NoEgJK3UmiDDa_Zlih-yp580idyxYEVEkaFAu'\
'rGyx-8rjUK98ZKnV2EKvx6q4PFTlQS8i_sJB8Aj5-aJkvM_SEdfpuZECaprixfNisFGNLqkZftHLsLX8sdtDQL6UY4TM'
}
resp = self.client.get(reverse('oauth-authenticated', args=('facebook',)), data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment