Skip to content

Commit

Permalink
Add additional viewset to verify simpleJWT extension
Browse files Browse the repository at this point in the history
  • Loading branch information
wmeints committed Apr 6, 2024
1 parent b228b38 commit c0a27e2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/contrib/test_simplejwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

try:
from rest_framework_simplejwt.authentication import (
JWTAuthentication, JWTTokenUserAuthentication,
JWTAuthentication, JWTTokenUserAuthentication, JWTStatelessUserAuthentication
)
from rest_framework_simplejwt.views import (
TokenObtainPairView, TokenObtainSlidingView, TokenRefreshView, TokenVerifyView,
Expand All @@ -33,9 +33,14 @@ class X2Viewset(mixins.ListModelMixin, viewsets.GenericViewSet):
authentication_classes = [JWTTokenUserAuthentication]
required_scopes = ['x:read', 'x:write']

class X3Viewset(mixins.ListModelMixin, viewsets.GenericViewSet):
serializer_class = XSerializer
authentication_classes = [JWTStatelessUserAuthentication]
required_scopes = ['x:read', 'x:write']


@pytest.mark.contrib('rest_framework_simplejwt')
@pytest.mark.parametrize('view', [XViewset, X2Viewset])
@pytest.mark.parametrize('view', [XViewset, X2Viewset, X3Viewset])
def test_simplejwt(no_warnings, view):
router = routers.SimpleRouter()
router.register('x', view, basename="x")
Expand Down

0 comments on commit c0a27e2

Please sign in to comment.