fix: fixed django40 warnings (#29641)
* fix: fixed django4 warnings Co-authored-by: UsamaSadiq <usama.sadiq@arbisoft.com>
This commit is contained in:
committed by
GitHub
parent
e8953398ac
commit
dd488a76d1
@@ -11,12 +11,12 @@ from datetime import timedelta
|
||||
|
||||
import ddt
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
from django.http import HttpResponse
|
||||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.utils.http import urlencode
|
||||
from django.utils.timezone import now
|
||||
from django.urls import path
|
||||
from oauth2_provider import models as dot_models
|
||||
from rest_framework import status
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
@@ -44,14 +44,12 @@ class MockView(APIView): # pylint: disable=missing-docstring
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
r'^oauth2-inactive-test/$',
|
||||
MockView.as_view(authentication_classes=[authentication.BearerAuthenticationAllowInactiveUser])
|
||||
),
|
||||
url(
|
||||
r'^oauth2-test/$',
|
||||
MockView.as_view(authentication_classes=[authentication.BearerAuthentication])
|
||||
)
|
||||
path('oauth2-inactive-test/',
|
||||
MockView.as_view(authentication_classes=[authentication.BearerAuthenticationAllowInactiveUser])
|
||||
),
|
||||
path('oauth2-test/',
|
||||
MockView.as_view(authentication_classes=[authentication.BearerAuthentication])
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"""
|
||||
Tests for (some of) the view utilities.
|
||||
"""
|
||||
from django.conf.urls import url
|
||||
from django.test.utils import override_settings
|
||||
from django.urls import re_path
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.test import APITestCase
|
||||
from rest_framework.views import APIView
|
||||
@@ -28,7 +28,7 @@ class MockAPIView(DeveloperErrorViewMixin, APIView):
|
||||
return Response(f"Success {course_id}")
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^mock/(?P<course_id>.*)/$', MockAPIView.as_view()), # Only works with new-style course keys
|
||||
re_path(r'^mock/(?P<course_id>.*)/$', MockAPIView.as_view()), # Only works with new-style course keys
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user