File tree 4 files changed +11
-8
lines changed
backend/src/openarchiefbeheer
4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 11
11
from rest_framework .response import Response
12
12
13
13
from openarchiefbeheer .logging import logevent
14
+ from openarchiefbeheer .utils .paginators import PageNumberPagination
14
15
15
16
from ..constants import InternalStatus , ListRole
16
17
from ..models import (
@@ -299,6 +300,7 @@ class DestructionListItemsViewSet(
299
300
queryset = DestructionListItem .objects .all ()
300
301
filter_backends = (DjangoFilterBackend ,)
301
302
filterset_class = DestructionListItemFilterset
303
+ pagination_class = PageNumberPagination
302
304
303
305
304
306
@extend_schema_view (
Original file line number Diff line number Diff line change @@ -819,7 +819,7 @@ def test_retrieve_destruction_list_items(self):
819
819
820
820
self .assertEqual (response .status_code , status .HTTP_200_OK )
821
821
822
- data = sorted (response .json (), key = lambda item : item ["zaak" ])
822
+ data = sorted (response .json ()[ "results" ] , key = lambda item : item ["zaak" ])
823
823
824
824
self .assertEqual (
825
825
data [0 ]["zaakData" ]["omschrijving" ],
@@ -868,7 +868,7 @@ def test_filter_items_on_destruction_list(self):
868
868
869
869
data = response .json ()
870
870
871
- self .assertEqual (len ( data ) , 2 )
871
+ self .assertEqual (data [ "count" ] , 2 )
872
872
873
873
874
874
class DestructionListReviewViewSetTest (APITestCase ):
Original file line number Diff line number Diff line change
1
+ from rest_framework .pagination import PageNumberPagination as _PageNumberPagination
2
+
3
+
4
+ class PageNumberPagination (_PageNumberPagination ):
5
+ page_size_query_param = "page_size"
6
+ page_size = 100
Original file line number Diff line number Diff line change 4
4
from drf_spectacular .utils import extend_schema , extend_schema_view
5
5
from rest_framework import mixins , viewsets
6
6
from rest_framework .filters import OrderingFilter
7
- from rest_framework .pagination import PageNumberPagination as _PageNumberPagination
8
7
from rest_framework .permissions import IsAuthenticated
9
8
10
9
from openarchiefbeheer .destruction .api .permissions import (
11
10
CanReviewPermission ,
12
11
CanStartDestructionPermission ,
13
12
)
13
+ from openarchiefbeheer .utils .paginators import PageNumberPagination
14
14
15
15
from ..models import Zaak
16
16
from .filtersets import ZaakFilter
17
17
from .serializers import ZaakSerializer
18
18
19
19
20
- class PageNumberPagination (_PageNumberPagination ):
21
- page_size_query_param = "page_size"
22
- page_size = 100
23
-
24
-
25
20
@extend_schema_view (
26
21
list = extend_schema (
27
22
summary = _ ("List zaken" ),
You can’t perform that action at this time.
0 commit comments