Fixing python-modernize issues.
This commit is contained in:
@@ -2,16 +2,17 @@
|
||||
Tests for `saml` management command, this command fetches saml metadata from providers and updates
|
||||
existing data accordingly.
|
||||
"""
|
||||
import unittest
|
||||
import os
|
||||
import mock
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.test import TestCase
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import mock
|
||||
from django.conf import settings
|
||||
from django.core.management import call_command
|
||||
from django.core.management.base import CommandError
|
||||
from django.conf import settings
|
||||
from django.test import TestCase
|
||||
from django.utils.six import StringIO
|
||||
|
||||
from requests import exceptions
|
||||
from requests.models import Response
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Provides factories for third_party_auth models.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
from factory import SubFactory
|
||||
from factory.django import DjangoModelFactory
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Tests for third_party_auth decorators.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
|
||||
import ddt
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Tests for third party auth middleware
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import mock
|
||||
from django.contrib.messages.middleware import MessageMiddleware
|
||||
from django.http import HttpResponse
|
||||
@@ -8,9 +10,9 @@ from django.test.client import RequestFactory
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
from student.helpers import get_next_url_for_login_page
|
||||
from third_party_auth.middleware import ExceptionMiddleware
|
||||
from third_party_auth.tests.testutil import TestCase
|
||||
from student.helpers import get_next_url_for_login_page
|
||||
|
||||
|
||||
class ThirdPartyAuthMiddlewareTestCase(TestCase):
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""Unit tests for third_party_auth/pipeline.py."""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
|
||||
from third_party_auth import pipeline
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
"""Integration tests for pipeline.py."""
|
||||
|
||||
import unittest
|
||||
from __future__ import absolute_import
|
||||
|
||||
import datetime
|
||||
import unittest
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
import pytz
|
||||
import ddt
|
||||
from django import test
|
||||
from django.contrib.auth import models
|
||||
from django.core import mail
|
||||
from social_django import models as social_models
|
||||
|
||||
from lms.djangoapps.verify_student.models import SSOVerification
|
||||
from student.tests.factories import UserFactory
|
||||
from third_party_auth import pipeline, provider
|
||||
from third_party_auth.tests import testutil
|
||||
from lms.djangoapps.verify_student.models import SSOVerification
|
||||
|
||||
# Get Django User model by reference from python-social-auth. Not a type
|
||||
# constant, pylint.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""Unit tests for provider.py."""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
|
||||
from django.contrib.sites.models import Site
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
Unit tests for third_party_auth SAML auth providers
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import mock
|
||||
|
||||
from third_party_auth.tests.testutil import SAMLTestCase
|
||||
from third_party_auth.saml import EdXSAMLIdentityProvider, get_saml_idp_class
|
||||
from third_party_auth.tests.data.saml_identity_provider_mock_data import mock_conf, mock_attributes,\
|
||||
expected_user_details
|
||||
from third_party_auth.tests.data.saml_identity_provider_mock_data import (
|
||||
expected_user_details,
|
||||
mock_attributes,
|
||||
mock_conf
|
||||
)
|
||||
from third_party_auth.tests.testutil import SAMLTestCase
|
||||
|
||||
|
||||
class TestEdXSAMLIdentityProvider(SAMLTestCase):
|
||||
|
||||
Reference in New Issue
Block a user