From 310da0d6a70176fe65988ed8a1cc506ec6ac8faa Mon Sep 17 00:00:00 2001 From: Jawayria Date: Fri, 12 Feb 2021 14:00:39 +0500 Subject: [PATCH] BOM-2351: Removed unused imports from common/djangoapps/third_party_auth --- .../djangoapps/third_party_auth/api/tests/test_permissions.py | 1 - common/djangoapps/third_party_auth/decorators.py | 4 +--- .../saml_configuration/tests/test_saml_configuration.py | 3 --- .../samlproviderconfig/tests/test_samlproviderconfig.py | 3 --- .../samlproviderdata/tests/test_samlproviderdata.py | 3 --- .../djangoapps/third_party_auth/tests/specs/test_generic.py | 3 --- .../djangoapps/third_party_auth/tests/specs/test_testshib.py | 1 - common/djangoapps/third_party_auth/tests/test_admin.py | 3 --- common/djangoapps/third_party_auth/tests/test_decorators.py | 4 ---- .../djangoapps/third_party_auth/tests/test_identityserver3.py | 2 -- common/djangoapps/third_party_auth/tests/test_pipeline.py | 1 - common/djangoapps/third_party_auth/tests/test_settings.py | 3 --- 12 files changed, 1 insertion(+), 30 deletions(-) diff --git a/common/djangoapps/third_party_auth/api/tests/test_permissions.py b/common/djangoapps/third_party_auth/api/tests/test_permissions.py index 87528cf0e0..4120b06fc5 100644 --- a/common/djangoapps/third_party_auth/api/tests/test_permissions.py +++ b/common/djangoapps/third_party_auth/api/tests/test_permissions.py @@ -10,7 +10,6 @@ from django.conf import settings from django.test import RequestFactory, TestCase from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication from edx_rest_framework_extensions.auth.jwt.tests.utils import generate_jwt -from mock import patch # lint-amnesty, pylint: disable=unused-import from rest_framework.authentication import SessionAuthentication from rest_framework.response import Response from rest_framework.views import APIView diff --git a/common/djangoapps/third_party_auth/decorators.py b/common/djangoapps/third_party_auth/decorators.py index 0ac563d902..1cab617795 100644 --- a/common/djangoapps/third_party_auth/decorators.py +++ b/common/djangoapps/third_party_auth/decorators.py @@ -6,12 +6,10 @@ Decorators that can be used to interact with third_party_auth. from functools import wraps from django.conf import settings -from django.shortcuts import redirect # lint-amnesty, pylint: disable=unused-import from django.utils.decorators import available_attrs -from six.moves.urllib.parse import urlencode, urlparse # lint-amnesty, pylint: disable=unused-import +from six.moves.urllib.parse import urlparse # lint-amnesty, pylint: disable=unused-import from common.djangoapps.third_party_auth.models import LTIProviderConfig -from common.djangoapps.third_party_auth.provider import Registry # lint-amnesty, pylint: disable=unused-import def xframe_allow_whitelisted(view_func): diff --git a/common/djangoapps/third_party_auth/saml_configuration/tests/test_saml_configuration.py b/common/djangoapps/third_party_auth/saml_configuration/tests/test_saml_configuration.py index 49e57ca546..540d73ad86 100644 --- a/common/djangoapps/third_party_auth/saml_configuration/tests/test_saml_configuration.py +++ b/common/djangoapps/third_party_auth/saml_configuration/tests/test_saml_configuration.py @@ -1,8 +1,6 @@ """ Tests for SAMLConfiguration endpoints """ - -import unittest # lint-amnesty, pylint: disable=unused-import from django.urls import reverse from django.contrib.sites.models import Site from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user @@ -10,7 +8,6 @@ from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imp from rest_framework import status from rest_framework.test import APITestCase from common.djangoapps.third_party_auth.models import SAMLConfiguration -from common.djangoapps.third_party_auth.tests import testutil # lint-amnesty, pylint: disable=unused-import from common.djangoapps.third_party_auth.tests.utils import skip_unless_thirdpartyauth SAML_CONFIGURATIONS = [ { diff --git a/common/djangoapps/third_party_auth/samlproviderconfig/tests/test_samlproviderconfig.py b/common/djangoapps/third_party_auth/samlproviderconfig/tests/test_samlproviderconfig.py index 91ef4c2b2a..29ccf53bb1 100644 --- a/common/djangoapps/third_party_auth/samlproviderconfig/tests/test_samlproviderconfig.py +++ b/common/djangoapps/third_party_auth/samlproviderconfig/tests/test_samlproviderconfig.py @@ -1,8 +1,6 @@ """ Tests for SAMLProviderConfig endpoints """ - -import unittest import copy from uuid import uuid4 from django.urls import reverse @@ -16,7 +14,6 @@ from enterprise.models import EnterpriseCustomerIdentityProvider, EnterpriseCust from enterprise.constants import ENTERPRISE_ADMIN_ROLE, ENTERPRISE_LEARNER_ROLE from common.djangoapps.third_party_auth.tests.samlutils import set_jwt_cookie from common.djangoapps.third_party_auth.models import SAMLProviderConfig, SAMLConfiguration -from common.djangoapps.third_party_auth.tests import testutil from common.djangoapps.third_party_auth.tests.utils import skip_unless_thirdpartyauth from common.djangoapps.third_party_auth.utils import convert_saml_slug_provider_id diff --git a/common/djangoapps/third_party_auth/samlproviderdata/tests/test_samlproviderdata.py b/common/djangoapps/third_party_auth/samlproviderdata/tests/test_samlproviderdata.py index ad9d14770f..8208d8ae88 100644 --- a/common/djangoapps/third_party_auth/samlproviderdata/tests/test_samlproviderdata.py +++ b/common/djangoapps/third_party_auth/samlproviderdata/tests/test_samlproviderdata.py @@ -1,4 +1,3 @@ -import unittest import copy import pytz from uuid import uuid4 @@ -12,8 +11,6 @@ from rest_framework.test import APITestCase from enterprise.models import EnterpriseCustomer, EnterpriseCustomerIdentityProvider from enterprise.constants import ENTERPRISE_ADMIN_ROLE, ENTERPRISE_LEARNER_ROLE - -from common.djangoapps.third_party_auth.tests import testutil from common.djangoapps.third_party_auth.models import SAMLProviderData, SAMLProviderConfig from common.djangoapps.third_party_auth.tests.samlutils import set_jwt_cookie from common.djangoapps.third_party_auth.tests.utils import skip_unless_thirdpartyauth diff --git a/common/djangoapps/third_party_auth/tests/specs/test_generic.py b/common/djangoapps/third_party_auth/tests/specs/test_generic.py index bb05947e63..f02ccd54d2 100644 --- a/common/djangoapps/third_party_auth/tests/specs/test_generic.py +++ b/common/djangoapps/third_party_auth/tests/specs/test_generic.py @@ -1,9 +1,6 @@ """ Use the 'Dummy' auth provider for generic integration tests of third_party_auth. """ - - -import unittest # lint-amnesty, pylint: disable=unused-import from common.djangoapps.third_party_auth.tests import testutil from common.djangoapps.third_party_auth.tests.utils import skip_unless_thirdpartyauth from .base import IntegrationTestMixin diff --git a/common/djangoapps/third_party_auth/tests/specs/test_testshib.py b/common/djangoapps/third_party_auth/tests/specs/test_testshib.py index 12290c4ada..30c8c7c391 100644 --- a/common/djangoapps/third_party_auth/tests/specs/test_testshib.py +++ b/common/djangoapps/third_party_auth/tests/specs/test_testshib.py @@ -7,7 +7,6 @@ import datetime import json import logging import os -import unittest # lint-amnesty, pylint: disable=unused-import from unittest import skip import ddt diff --git a/common/djangoapps/third_party_auth/tests/test_admin.py b/common/djangoapps/third_party_auth/tests/test_admin.py index 102bba22df..7099911e55 100644 --- a/common/djangoapps/third_party_auth/tests/test_admin.py +++ b/common/djangoapps/third_party_auth/tests/test_admin.py @@ -2,9 +2,6 @@ Tests third_party_auth admin views """ - -import unittest # lint-amnesty, pylint: disable=unused-import - from django.contrib.admin.sites import AdminSite from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import models diff --git a/common/djangoapps/third_party_auth/tests/test_decorators.py b/common/djangoapps/third_party_auth/tests/test_decorators.py index 97d6945f22..0a2c732c4d 100644 --- a/common/djangoapps/third_party_auth/tests/test_decorators.py +++ b/common/djangoapps/third_party_auth/tests/test_decorators.py @@ -2,11 +2,7 @@ Tests for third_party_auth decorators. """ - -import unittest # lint-amnesty, pylint: disable=unused-import - import ddt -from django.conf import settings # lint-amnesty, pylint: disable=unused-import from django.http import HttpResponse from django.test import RequestFactory diff --git a/common/djangoapps/third_party_auth/tests/test_identityserver3.py b/common/djangoapps/third_party_auth/tests/test_identityserver3.py index c64f4f1d80..40796070d2 100644 --- a/common/djangoapps/third_party_auth/tests/test_identityserver3.py +++ b/common/djangoapps/third_party_auth/tests/test_identityserver3.py @@ -3,8 +3,6 @@ Unit tests for the IdentityServer3 OAuth2 Backend """ import json import ddt -import pytest # pylint: disable=unused-import - from common.djangoapps.third_party_auth.identityserver3 import IdentityServer3 from common.djangoapps.third_party_auth.tests import testutil from common.djangoapps.third_party_auth.tests.utils import skip_unless_thirdpartyauth diff --git a/common/djangoapps/third_party_auth/tests/test_pipeline.py b/common/djangoapps/third_party_auth/tests/test_pipeline.py index be85047d8d..9c3c265de9 100644 --- a/common/djangoapps/third_party_auth/tests/test_pipeline.py +++ b/common/djangoapps/third_party_auth/tests/test_pipeline.py @@ -2,7 +2,6 @@ import json -import unittest # lint-amnesty, pylint: disable=unused-import import ddt import mock diff --git a/common/djangoapps/third_party_auth/tests/test_settings.py b/common/djangoapps/third_party_auth/tests/test_settings.py index af3d280a3c..a56273759b 100644 --- a/common/djangoapps/third_party_auth/tests/test_settings.py +++ b/common/djangoapps/third_party_auth/tests/test_settings.py @@ -1,8 +1,5 @@ """Unit tests for settings.py.""" - -import unittest # lint-amnesty, pylint: disable=unused-import - from mock import patch from common.djangoapps.third_party_auth import provider, settings from common.djangoapps.third_party_auth.tests import testutil