Skip to content

Commit

Permalink
Remove django 3.1 specific test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
KundaPanda committed Jan 13, 2022
1 parent 37de71b commit f8f0ff8
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions tests/test_backends.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import base64

import django
import pytest
from django.contrib.auth.models import User
from django.test import Client, TestCase as DjangoTestCase
Expand Down Expand Up @@ -84,13 +83,10 @@ def setUp(self):
self.backend = JSONWebTokenBackend()

async def test_authenticate_async(self):
name = (
jwt_settings.JWT_AUTH_HEADER_NAME
if django.VERSION[:2] < (3, 2)
else jwt_settings.JWT_AUTH_HEADER_NAME.replace("HTTP_", "")
)
headers = {
name: f"{jwt_settings.JWT_AUTH_HEADER_PREFIX} {self.token}",
jwt_settings.JWT_AUTH_HEADER_NAME.replace(
"HTTP_", ""
): f"{jwt_settings.JWT_AUTH_HEADER_PREFIX} {self.token}",
}

request = self.request_factory.get("/", **headers)
Expand All @@ -99,13 +95,10 @@ async def test_authenticate_async(self):
self.assertEqual(user, self.user)

async def test_authenticate_fail_async(self):
name = (
jwt_settings.JWT_AUTH_HEADER_NAME
if django.VERSION[:2] < (3, 2)
else jwt_settings.JWT_AUTH_HEADER_NAME.replace("HTTP_", "")
)
headers = {
name: f"{jwt_settings.JWT_AUTH_HEADER_PREFIX} invalid",
jwt_settings.JWT_AUTH_HEADER_NAME.replace(
"HTTP_", ""
): f"{jwt_settings.JWT_AUTH_HEADER_PREFIX} invalid",
}

request = self.request_factory.get("/", **headers)
Expand Down

0 comments on commit f8f0ff8

Please sign in to comment.