This repository was archived by the owner on May 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-19
lines changed Expand file tree Collapse file tree 3 files changed +14
-19
lines changed Original file line number Diff line number Diff line change 22
33from django .http import HttpResponse
44from django .test import TestCase
5- from django .conf .urls import patterns
5+ from django .conf .urls import url
66
77from rest_framework import permissions , status
88try :
@@ -54,19 +54,18 @@ def post(self, request):
5454 return HttpResponse ({'a' : 1 , 'b' : 2 , 'c' : 3 })
5555
5656
57- urlpatterns = patterns (
58- '' ,
59- (r'^jwt/$' , MockView .as_view (
57+ urlpatterns = [
58+ url (r'^jwt/$' , MockView .as_view (
6059 authentication_classes = [JSONWebTokenAuthentication ])),
6160
62- (r'^jwt-oauth2/$' , MockView .as_view (
61+ url (r'^jwt-oauth2/$' , MockView .as_view (
6362 authentication_classes = [
6463 JSONWebTokenAuthentication , OAuth2Authentication ])),
6564
66- (r'^oauth2-jwt/$' , MockView .as_view (
65+ url (r'^oauth2-jwt/$' , MockView .as_view (
6766 authentication_classes = [
6867 OAuth2Authentication , JSONWebTokenAuthentication ])),
69- )
68+ ]
7069
7170
7271class JSONWebTokenAuthenticationTests (TestCase ):
Original file line number Diff line number Diff line change 66from django import get_version
77from django .test import TestCase
88from django .test .utils import override_settings
9- from django .conf .urls import patterns
9+ from django .conf .urls import url
1010from rest_framework import status
1111from rest_framework .test import APIClient
1212
13- from rest_framework_jwt import utils
13+ from rest_framework_jwt import utils , views
1414from rest_framework_jwt .compat import get_user_model
1515from rest_framework_jwt .settings import api_settings , DEFAULTS
1616
2323
2424NO_CUSTOM_USER_MODEL = 'Custom User Model only supported after Django 1.5'
2525
26- urlpatterns = patterns (
27- '' ,
28- (r'^auth-token/$' , 'rest_framework_jwt.views.obtain_jwt_token' ),
29- (r'^auth-token-refresh/$' , 'rest_framework_jwt.views.refresh_jwt_token' ),
30- (r'^auth-token-verify/$' , 'rest_framework_jwt.views.verify_jwt_token' ),
31-
32- )
26+ urlpatterns = [
27+ url (r'^auth-token/$' , views .obtain_jwt_token ),
28+ url (r'^auth-token-refresh/$' , views .refresh_jwt_token ),
29+ url (r'^auth-token-verify/$' , views .verify_jwt_token ),
30+ ]
3331
3432orig_datetime = datetime
3533
Original file line number Diff line number Diff line change 11"""
22Blank URLConf just to keep the test suite happy
33"""
4- from django .conf .urls import patterns
5-
6- urlpatterns = patterns ('' )
4+ urlpatterns = []
You can’t perform that action at this time.
0 commit comments