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 2
2
3
3
from django .http import HttpResponse
4
4
from django .test import TestCase
5
- from django .conf .urls import patterns
5
+ from django .conf .urls import url
6
6
7
7
from rest_framework import permissions , status
8
8
try :
@@ -54,19 +54,18 @@ def post(self, request):
54
54
return HttpResponse ({'a' : 1 , 'b' : 2 , 'c' : 3 })
55
55
56
56
57
- urlpatterns = patterns (
58
- '' ,
59
- (r'^jwt/$' , MockView .as_view (
57
+ urlpatterns = [
58
+ url (r'^jwt/$' , MockView .as_view (
60
59
authentication_classes = [JSONWebTokenAuthentication ])),
61
60
62
- (r'^jwt-oauth2/$' , MockView .as_view (
61
+ url (r'^jwt-oauth2/$' , MockView .as_view (
63
62
authentication_classes = [
64
63
JSONWebTokenAuthentication , OAuth2Authentication ])),
65
64
66
- (r'^oauth2-jwt/$' , MockView .as_view (
65
+ url (r'^oauth2-jwt/$' , MockView .as_view (
67
66
authentication_classes = [
68
67
OAuth2Authentication , JSONWebTokenAuthentication ])),
69
- )
68
+ ]
70
69
71
70
72
71
class JSONWebTokenAuthenticationTests (TestCase ):
Original file line number Diff line number Diff line change 6
6
from django import get_version
7
7
from django .test import TestCase
8
8
from django .test .utils import override_settings
9
- from django .conf .urls import patterns
9
+ from django .conf .urls import url
10
10
from rest_framework import status
11
11
from rest_framework .test import APIClient
12
12
13
- from rest_framework_jwt import utils
13
+ from rest_framework_jwt import utils , views
14
14
from rest_framework_jwt .compat import get_user_model
15
15
from rest_framework_jwt .settings import api_settings , DEFAULTS
16
16
23
23
24
24
NO_CUSTOM_USER_MODEL = 'Custom User Model only supported after Django 1.5'
25
25
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
+ ]
33
31
34
32
orig_datetime = datetime
35
33
Original file line number Diff line number Diff line change 1
1
"""
2
2
Blank URLConf just to keep the test suite happy
3
3
"""
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