diff --git a/common/djangoapps/third_party_auth/management/commands/tests/test_saml.py b/common/djangoapps/third_party_auth/management/commands/tests/test_saml.py index b9c76f470d917f71271bbe5677f32436b6690da7..c471277f88f310a08005b59c32280d5d295abb1d 100644 --- a/common/djangoapps/third_party_auth/management/commands/tests/test_saml.py +++ b/common/djangoapps/third_party_auth/management/commands/tests/test_saml.py @@ -2,16 +2,17 @@ Tests for `saml` management command, this command fetches saml metadata from providers and updates existing data accordingly. """ -import unittest +from __future__ import absolute_import + import os -import mock +import unittest -from django.test import TestCase +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 diff --git a/common/djangoapps/third_party_auth/tests/factories.py b/common/djangoapps/third_party_auth/tests/factories.py index b0fafd25a65160acc9b4b28241aa9f2571d8b555..f47cb48fc8c7de0e20e63bb3c88598ca39d8f960 100644 --- a/common/djangoapps/third_party_auth/tests/factories.py +++ b/common/djangoapps/third_party_auth/tests/factories.py @@ -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 diff --git a/common/djangoapps/third_party_auth/tests/test_decorators.py b/common/djangoapps/third_party_auth/tests/test_decorators.py index c069ac412de2836844dce685e25cb49fa769c255..c6a9962334bc3339a5ece4110618238092b15d23 100644 --- a/common/djangoapps/third_party_auth/tests/test_decorators.py +++ b/common/djangoapps/third_party_auth/tests/test_decorators.py @@ -1,6 +1,8 @@ """ Tests for third_party_auth decorators. """ +from __future__ import absolute_import + import unittest import ddt diff --git a/common/djangoapps/third_party_auth/tests/test_middleware.py b/common/djangoapps/third_party_auth/tests/test_middleware.py index 88757b264af68572729be78f21351c7bef1854ad..8a3558beb5d8da9ac316771edb7b36f475ac9bc2 100644 --- a/common/djangoapps/third_party_auth/tests/test_middleware.py +++ b/common/djangoapps/third_party_auth/tests/test_middleware.py @@ -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): diff --git a/common/djangoapps/third_party_auth/tests/test_pipeline.py b/common/djangoapps/third_party_auth/tests/test_pipeline.py index b4f700275b4516642b7829c2addaa0f5528a3cc8..a3250a0aa6c05fe6de6853ea9628e0f0d6d28952 100644 --- a/common/djangoapps/third_party_auth/tests/test_pipeline.py +++ b/common/djangoapps/third_party_auth/tests/test_pipeline.py @@ -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 diff --git a/common/djangoapps/third_party_auth/tests/test_pipeline_integration.py b/common/djangoapps/third_party_auth/tests/test_pipeline_integration.py index ff68e84aede507af6875cea0771835d0dcc38b39..1486f110cc15d1e760d79cb6bee2c2110447793b 100644 --- a/common/djangoapps/third_party_auth/tests/test_pipeline_integration.py +++ b/common/djangoapps/third_party_auth/tests/test_pipeline_integration.py @@ -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. diff --git a/common/djangoapps/third_party_auth/tests/test_provider.py b/common/djangoapps/third_party_auth/tests/test_provider.py index 2507f04dd7a22df0384191475b1473f4855c8249..c9749b937f412e47a25a930473d6918c1014acad 100644 --- a/common/djangoapps/third_party_auth/tests/test_provider.py +++ b/common/djangoapps/third_party_auth/tests/test_provider.py @@ -1,5 +1,7 @@ """Unit tests for provider.py.""" +from __future__ import absolute_import + import unittest from django.contrib.sites.models import Site diff --git a/common/djangoapps/third_party_auth/tests/test_saml.py b/common/djangoapps/third_party_auth/tests/test_saml.py index fcf1d3d24cd87ef976d2cd78a7503af9ae7d330c..c956f8fa2002540d14f147fd419e1533df55da46 100644 --- a/common/djangoapps/third_party_auth/tests/test_saml.py +++ b/common/djangoapps/third_party_auth/tests/test_saml.py @@ -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):