Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit fd2bfbb

Browse files
committed
Use url instead of patterns.
1 parent 6d79041 commit fd2bfbb

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

tests/test_authentication.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from django.http import HttpResponse
44
from django.test import TestCase
5-
from django.conf.urls import patterns
5+
from django.conf.urls import url
66

77
from rest_framework import permissions, status
88
try:
@@ -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

7271
class JSONWebTokenAuthenticationTests(TestCase):

tests/test_views.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
from django import get_version
77
from django.test import TestCase
88
from django.test.utils import override_settings
9-
from django.conf.urls import patterns
9+
from django.conf.urls import url
1010
from rest_framework import status
1111
from rest_framework.test import APIClient
1212

13-
from rest_framework_jwt import utils
13+
from rest_framework_jwt import utils, views
1414
from rest_framework_jwt.compat import get_user_model
1515
from rest_framework_jwt.settings import api_settings, DEFAULTS
1616

@@ -23,13 +23,11 @@
2323

2424
NO_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

3432
orig_datetime = datetime
3533

tests/urls.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"""
22
Blank URLConf just to keep the test suite happy
33
"""
4-
from django.conf.urls import patterns
5-
6-
urlpatterns = patterns('')
4+
urlpatterns = []

0 commit comments

Comments
 (0)