def test_oauth2_flow_finish_is_denied(): factory = RequestFactory() request = factory.get('contrib-dropbox/oauth2_flow/start-list') request.session = {} services.oauth2_flow_start(request) request.QUERY_PARAMS = {'code': '', 'state': str(request.session[services.CSRF_TOKEN])} with pytest.raises(Exception) as exc: services.oauth2_flow_finish(request) assert HTTPError == type(exc.value)
def get_queryset(self, request): return services.oauth2_flow_finish(request)