File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1- from django .conf .global_settings import MIDDLEWARE
21from django .contrib .auth import get_user_model
32from django .contrib .auth .models import AnonymousUser
43from django .http import HttpResponse
54from django .test import RequestFactory , TestCase
6- from django .test .utils import override_settings
5+ from django .test .utils import modify_settings , override_settings
76from django .utils .timezone import now , timedelta
87
98from oauth2_provider .backends import OAuth2Backend
@@ -80,7 +79,11 @@ def test_get_user(self):
8079 "oauth2_provider.backends.OAuth2Backend" ,
8180 "django.contrib.auth.backends.ModelBackend" ,
8281 ),
83- MIDDLEWARE = tuple (MIDDLEWARE ) + ("oauth2_provider.middleware.OAuth2TokenMiddleware" , ),
82+ )
83+ @modify_settings (
84+ MIDDLEWARE = {
85+ "append" : "oauth2_provider.middleware.OAuth2TokenMiddleware" ,
86+ }
8487)
8588class TestOAuth2Middleware (BaseTest ):
8689
You can’t perform that action at this time.
0 commit comments