|
1 | 1 | from datetime import timedelta |
2 | 2 |
|
3 | | -from django.conf.urls import include, url |
| 3 | +from django.conf.urls import include |
4 | 4 | from django.contrib.auth import get_user_model |
5 | 5 | from django.core.exceptions import ImproperlyConfigured |
6 | 6 | from django.http import HttpResponse |
7 | 7 | from django.test import TestCase |
8 | 8 | from django.test.utils import override_settings |
| 9 | +from django.urls import path, re_path |
9 | 10 | from django.utils import timezone |
10 | 11 | from rest_framework import permissions |
11 | 12 | from rest_framework.authentication import BaseAuthentication |
@@ -109,17 +110,17 @@ class AuthenticationNoneOAuth2View(MockView): |
109 | 110 |
|
110 | 111 |
|
111 | 112 | urlpatterns = [ |
112 | | - url(r"^oauth2/", include("oauth2_provider.urls")), |
113 | | - url(r"^oauth2-test/$", OAuth2View.as_view()), |
114 | | - url(r"^oauth2-scoped-test/$", ScopedView.as_view()), |
115 | | - url(r"^oauth2-scoped-missing-auth/$", TokenHasScopeViewWrongAuth.as_view()), |
116 | | - url(r"^oauth2-read-write-test/$", ReadWriteScopedView.as_view()), |
117 | | - url(r"^oauth2-resource-scoped-test/$", ResourceScopedView.as_view()), |
118 | | - url(r"^oauth2-authenticated-or-scoped-test/$", AuthenticatedOrScopedView.as_view()), |
119 | | - url(r"^oauth2-method-scope-test/.*$", MethodScopeAltView.as_view()), |
120 | | - url(r"^oauth2-method-scope-fail/$", MethodScopeAltViewBad.as_view()), |
121 | | - url(r"^oauth2-method-scope-missing-auth/$", MethodScopeAltViewWrongAuth.as_view()), |
122 | | - url(r"^oauth2-authentication-none/$", AuthenticationNoneOAuth2View.as_view()), |
| 113 | + path("oauth2/", include("oauth2_provider.urls")), |
| 114 | + path("oauth2-test/", OAuth2View.as_view()), |
| 115 | + path("oauth2-scoped-test/", ScopedView.as_view()), |
| 116 | + path("oauth2-scoped-missing-auth/", TokenHasScopeViewWrongAuth.as_view()), |
| 117 | + path("oauth2-read-write-test/", ReadWriteScopedView.as_view()), |
| 118 | + path("oauth2-resource-scoped-test/", ResourceScopedView.as_view()), |
| 119 | + path("oauth2-authenticated-or-scoped-test/", AuthenticatedOrScopedView.as_view()), |
| 120 | + re_path(r"oauth2-method-scope-test/.*$", MethodScopeAltView.as_view()), |
| 121 | + path("oauth2-method-scope-fail/", MethodScopeAltViewBad.as_view()), |
| 122 | + path("oauth2-method-scope-missing-auth/", MethodScopeAltViewWrongAuth.as_view()), |
| 123 | + path("oauth2-authentication-none/", AuthenticationNoneOAuth2View.as_view()), |
123 | 124 | ] |
124 | 125 |
|
125 | 126 |
|
|
0 commit comments