コード例 #1
0
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')