Merge branch 'fix-import-all' of https://github.com/grahamu/django-oidc-provider into grahamu-fix-import-all

This commit is contained in:
Ignacio Fiorentino 2016-08-12 12:02:48 -03:00
commit d35f16eeae
11 changed files with 103 additions and 35 deletions

View file

@ -1,3 +1,4 @@
from datetime import timedelta
import logging
try:
from urllib import urlencode
@ -8,10 +9,22 @@ except ImportError:
from django.utils import timezone
from oidc_provider.lib.claims import StandardScopeClaims
from oidc_provider.lib.errors import *
from oidc_provider.lib.utils.params import *
from oidc_provider.lib.utils.token import *
from oidc_provider.models import *
from oidc_provider.lib.errors import (
AuthorizeError,
ClientIdError,
RedirectUriError,
)
from oidc_provider.lib.utils.params import Params
from oidc_provider.lib.utils.token import (
create_code,
create_id_token,
create_token,
encode_id_token,
)
from oidc_provider.models import (
Client,
UserConsent,
)
from oidc_provider import settings

View file

@ -9,10 +9,20 @@ except ImportError:
from django.http import JsonResponse
from oidc_provider.lib.errors import *
from oidc_provider.lib.utils.params import *
from oidc_provider.lib.utils.token import *
from oidc_provider.models import *
from oidc_provider.lib.errors import (
TokenError,
)
from oidc_provider.lib.utils.params import Params
from oidc_provider.lib.utils.token import (
create_id_token,
create_token,
encode_id_token,
)
from oidc_provider.models import (
Client,
Code,
Token,
)
from oidc_provider import settings

View file

@ -9,7 +9,11 @@ from jwkest.jwk import SYMKey
from jwkest.jws import JWS
from oidc_provider.lib.utils.common import get_issuer
from oidc_provider.models import *
from oidc_provider.models import (
Code,
RSAKey,
Token,
)
from oidc_provider import settings

View file

@ -1,4 +1,3 @@
import os
import random
import string
try:
@ -8,7 +7,10 @@ except ImportError:
from django.contrib.auth.models import User
from oidc_provider.models import *
from oidc_provider.models import (
Client,
Code,
)
FAKE_NONCE = 'cb584e44c43ed6bd0bc2d9c7e242837d'

View file

@ -16,9 +16,13 @@ from django.test import TestCase
from jwkest.jwt import JWT
from oidc_provider import settings
from oidc_provider.models import *
from oidc_provider.tests.app.utils import *
from oidc_provider.views import *
from oidc_provider.tests.app.utils import (
create_fake_user,
create_fake_client,
FAKE_CODE_CHALLENGE,
is_code_valid,
)
from oidc_provider.views import AuthorizeView
class AuthorizationCodeFlowTestCase(TestCase):

View file

@ -1,8 +1,7 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from oidc_provider.views import *
from oidc_provider.tests.app.utils import *
from oidc_provider.tests.app.utils import create_fake_user
class UserInfoTestCase(TestCase):

View file

@ -2,7 +2,7 @@ from django.core.urlresolvers import reverse
from django.test import RequestFactory
from django.test import TestCase
from oidc_provider.views import *
from oidc_provider.views import ProviderInfoView
class ProviderInfoTestCase(TestCase):

View file

@ -1,3 +1,7 @@
from datetime import timedelta
import json
import uuid
from base64 import b64encode
try:
from urllib.parse import urlencode
@ -5,15 +9,30 @@ except ImportError:
from urllib import urlencode
from django.core.management import call_command
from django.core.urlresolvers import reverse
from django.test import RequestFactory, override_settings
from django.test import TestCase
from django.utils import timezone
from jwkest.jwk import KEYS
from jwkest.jws import JWS
from jwkest.jwt import JWT
from mock import patch
from oidc_provider.lib.utils.token import *
from oidc_provider.tests.app.utils import *
from oidc_provider.views import *
from oidc_provider.lib.utils.token import create_code
from oidc_provider.models import Token
from oidc_provider.tests.app.utils import (
create_fake_user,
create_fake_client,
FAKE_CODE_CHALLENGE,
FAKE_CODE_VERIFIER,
FAKE_NONCE,
FAKE_RANDOM_STRING,
)
from oidc_provider.views import (
JwksView,
TokenView,
userinfo,
)
class TokenTestCase(TestCase):

View file

@ -1,3 +1,5 @@
import json
from datetime import timedelta
try:
from urllib.parse import urlencode
@ -9,9 +11,15 @@ from django.test import RequestFactory
from django.test import TestCase
from django.utils import timezone
from oidc_provider.lib.utils.token import *
from oidc_provider.models import *
from oidc_provider.tests.app.utils import *
from oidc_provider.lib.utils.token import (
create_id_token,
create_token,
)
from oidc_provider.tests.app.utils import (
create_fake_user,
create_fake_client,
FAKE_NONCE,
)
from oidc_provider.views import userinfo

View file

@ -1,3 +1,5 @@
import logging
from Crypto.PublicKey import RSA
from django.contrib.auth.views import redirect_to_login, logout
from django.core.urlresolvers import reverse
@ -9,9 +11,14 @@ from django.views.generic import View
from jwkest import long_to_base64
from oidc_provider.lib.claims import StandardScopeClaims
from oidc_provider.lib.endpoints.authorize import *
from oidc_provider.lib.endpoints.token import *
from oidc_provider.lib.errors import *
from oidc_provider.lib.endpoints.authorize import AuthorizeEndpoint
from oidc_provider.lib.endpoints.token import TokenEndpoint
from oidc_provider.lib.errors import (
AuthorizeError,
ClientIdError,
RedirectUriError,
TokenError,
)
from oidc_provider.lib.utils.common import redirect, get_site_url, get_issuer
from oidc_provider.lib.utils.oauth2 import protected_resource_view
from oidc_provider.models import RESPONSE_TYPE_CHOICES, RSAKey

View file

@ -98,10 +98,12 @@ def runtests(*test_args):
try:
from django.test.runner import DiscoverRunner
runner_class = DiscoverRunner
if not test_args:
test_args = ["oidc_provider.tests"]
except ImportError:
from django.test.simple import DjangoTestSuiteRunner
runner_class = DjangoTestSuiteRunner
if not test_args:
test_args = ["tests"]
failures = runner_class(verbosity=1, interactive=True, failfast=False).run_tests(test_args)