Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-r requirements.txt
pytest==2.9.2
pytest==5.3.5
2 changes: 1 addition & 1 deletion rest_framework_sso/keys.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# coding: utf-8
import os
import six

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import load_pem_private_key, load_pem_public_key
from django.utils import six
from jwt.exceptions import InvalidKeyError

from rest_framework_sso.settings import api_settings
Expand Down
11 changes: 8 additions & 3 deletions rest_framework_sso/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
from __future__ import absolute_import, unicode_literals

import uuid
import six

from django.conf import settings
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible

try:
from django.utils.encoding import python_2_unicode_compatible as smart_text
except ImportError:
from django.utils.encoding import smart_text

from django.utils.translation import ugettext_lazy as _

# Prior to Django 1.5, the AUTH_USER_MODEL setting does not exist.
Expand All @@ -22,7 +27,7 @@
AUTH_USER_MODEL = getattr(settings, "AUTH_USER_MODEL", "auth.User")


@python_2_unicode_compatible
@smart_text
class SessionToken(models.Model):
"""
The default session token model.
Expand Down
6 changes: 4 additions & 2 deletions rest_framework_sso/utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# coding: utf-8
from __future__ import absolute_import, unicode_literals

import six
import jwt

from datetime import datetime

import jwt
from django.contrib.auth import get_user_model
from django.core.serializers.json import DjangoJSONEncoder
from django.utils import six, timezone
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from jwt.exceptions import MissingRequiredClaimError, InvalidIssuerError, InvalidTokenError
from rest_framework import exceptions
Expand Down
2 changes: 1 addition & 1 deletion runtests.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
DJANGO_SETTINGS_MODULE='tests.settings' py.test tests
DJANGO_SETTINGS_MODULE='tests.settings' pytest tests
2 changes: 1 addition & 1 deletion tests/test_keys.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import six

from cryptography.hazmat.backends.openssl.rsa import _RSAPrivateKey, _RSAPublicKey
from django.test import TestCase
from django.utils import six
from jwt.exceptions import InvalidKeyError

from rest_framework_sso import keys
Expand Down