Skip to content

Commit 943d9ff

Browse files
committed
tests: Remove Django<1.10 hacks
1 parent a753542 commit 943d9ff

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

tests/settings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
"django.contrib.auth.middleware.AuthenticationMiddleware",
6565
"django.contrib.messages.middleware.MessageMiddleware",
6666
)
67-
# Django < 1.10 compatibility
68-
MIDDLEWARE_CLASSES = MIDDLEWARE
6967

7068
ROOT_URLCONF = "tests.urls"
7169

tests/test_auth_backends.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from django.conf.global_settings import MIDDLEWARE
12
from django.contrib.auth import get_user_model
23
from django.contrib.auth.models import AnonymousUser
34
from django.http import HttpResponse
@@ -11,11 +12,6 @@
1112
get_access_token_model,
1213
get_application_model,
1314
)
14-
try:
15-
# Django<1.10 compatibility
16-
from django.conf.global_settings import MIDDLEWARE_CLASSES as MIDDLEWARE
17-
except ImportError:
18-
from django.conf.global_settings import MIDDLEWARE
1915

2016

2117
UserModel = get_user_model()
@@ -84,9 +80,7 @@ def test_get_user(self):
8480
"oauth2_provider.backends.OAuth2Backend",
8581
"django.contrib.auth.backends.ModelBackend",
8682
),
87-
MIDDLEWARE=tuple(MIDDLEWARE) + ("oauth2_provider.middleware.OAuth2TokenMiddleware",),
88-
# Django<1.10 compat:
89-
MIDDLEWARE_CLASSES=tuple(MIDDLEWARE) + ("oauth2_provider.middleware.OAuth2TokenMiddleware",)
83+
MIDDLEWARE=tuple(MIDDLEWARE) + ("oauth2_provider.middleware.OAuth2TokenMiddleware", ),
9084
)
9185
class TestOAuth2Middleware(BaseTest):
9286

0 commit comments

Comments
 (0)