Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/api/test_throttling.py
- This file was moved from swh/web/tests/common/test_throttling.py.
Show All 11 Lines | |||||
from django.conf.urls import url | from django.conf.urls import url | ||||
from django.test.utils import override_settings | from django.test.utils import override_settings | ||||
from rest_framework.views import APIView | from rest_framework.views import APIView | ||||
from rest_framework.response import Response | from rest_framework.response import Response | ||||
from rest_framework.decorators import api_view | from rest_framework.decorators import api_view | ||||
from swh.web.common.throttling import SwhWebRateThrottle, throttle_scope | from swh.web.api.throttling import SwhWebRateThrottle, throttle_scope | ||||
class MockViewScope1(APIView): | class MockViewScope1(APIView): | ||||
throttle_classes = (SwhWebRateThrottle,) | throttle_classes = (SwhWebRateThrottle,) | ||||
throttle_scope = 'scope1' | throttle_scope = 'scope1' | ||||
def get(self, request): | def get(self, request): | ||||
return Response('foo_get') | return Response('foo_get') | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |