class TestAuthorizeModel(TestCase):
    def setUp(self):
        self.authentication = AuthenticationFactory()

    def test_raise_exception_on_invalid_access_token(self):
        response = json.dumps({'error': 'bad_verification_code'})
        with self.assertRaises(BadVerificationCode):
            with HTTMock(lambda url, request: response):
                self.authentication.get_access_token('derp')
 def setUp(self):
     self.authentication = AuthenticationFactory()
 def setUp(self):
     self.authorization = AuthenticationFactory()
     self.url = "?code=foo&state=%d" % self.authorization.pk