diff --git a/cms/djangoapps/contentstore/features/course-settings.py b/cms/djangoapps/contentstore/features/course-settings.py index 350eb0392e..669d76c248 100644 --- a/cms/djangoapps/contentstore/features/course-settings.py +++ b/cms/djangoapps/contentstore/features/course-settings.py @@ -3,7 +3,7 @@ from lettuce import world, step from selenium.webdriver.common.keys import Keys -from common import type_in_codemirror, upload_file +from common import type_in_codemirror from django.conf import settings from nose.tools import assert_true, assert_false diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index e30ef1ff57..8b82033275 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -2,7 +2,6 @@ import copy import mock -from mock import patch import shutil import lxml.html from lxml import etree diff --git a/cms/djangoapps/contentstore/tests/test_i18n.py b/cms/djangoapps/contentstore/tests/test_i18n.py index 612b39c76f..82e568cb40 100644 --- a/cms/djangoapps/contentstore/tests/test_i18n.py +++ b/cms/djangoapps/contentstore/tests/test_i18n.py @@ -10,7 +10,6 @@ from contentstore.tests.utils import AjaxEnabledTestClient from xmodule.modulestore.django import ModuleI18nService from django.utils import translation from django.utils.translation import get_language -from django.conf import settings from xmodule.modulestore.tests.factories import ItemFactory, CourseFactory from contentstore.views.preview import _preview_module_system diff --git a/cms/djangoapps/contentstore/tests/test_libraries.py b/cms/djangoapps/contentstore/tests/test_libraries.py index 0e45222f10..783bc99d4f 100644 --- a/cms/djangoapps/contentstore/tests/test_libraries.py +++ b/cms/djangoapps/contentstore/tests/test_libraries.py @@ -14,7 +14,6 @@ from student.roles import ( CourseInstructorRole, CourseStaffRole, CourseCreatorRole, LibraryUserRole, OrgStaffRole, OrgInstructorRole, OrgLibraryUserRole, ) -from xblock.reference.user_service import XBlockUser from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index f493447437..605c2b8353 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -3,7 +3,6 @@ Common utility functions useful throughout the contentstore """ import logging -import re from datetime import datetime from pytz import UTC diff --git a/cms/djangoapps/contentstore/views/dev.py b/cms/djangoapps/contentstore/views/dev.py index 7cf69eeb7f..2b2178eaba 100644 --- a/cms/djangoapps/contentstore/views/dev.py +++ b/cms/djangoapps/contentstore/views/dev.py @@ -5,8 +5,6 @@ in a 404 error. """ # pylint: disable=unused-argument from edxmako.shortcuts import render_to_response -from mako.exceptions import TopLevelLookupException -from django.http import HttpResponseNotFound def dev_mode(request): diff --git a/cms/djangoapps/contentstore/views/helpers.py b/cms/djangoapps/contentstore/views/helpers.py index 5a0a45ca21..29e571c5b6 100644 --- a/cms/djangoapps/contentstore/views/helpers.py +++ b/cms/djangoapps/contentstore/views/helpers.py @@ -9,10 +9,9 @@ import urllib from django.conf import settings from django.http import HttpResponse -from django.shortcuts import redirect from django.utils.translation import ugettext as _ -from edxmako.shortcuts import render_to_string, render_to_response +from edxmako.shortcuts import render_to_string from opaque_keys.edx.keys import UsageKey from xblock.core import XBlock import dogstats_wrapper as dog_stats_api diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 2a2aef5a74..c3a185f86d 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -27,7 +27,6 @@ from xblock.runtime import KvsFieldData from xblock.django.request import webob_to_django_response, django_to_webob_request from xblock.exceptions import NoSuchHandlerError from xblock.fragment import Fragment -from student.auth import has_studio_read_access, has_studio_write_access from xblock_django.user_service import DjangoXBlockUserService from lms.djangoapps.lms_xblock.field_data import LmsFieldData diff --git a/cms/djangoapps/contentstore/views/tests/test_course_index.py b/cms/djangoapps/contentstore/views/tests/test_course_index.py index 121c998a69..9ec4ea7632 100644 --- a/cms/djangoapps/contentstore/views/tests/test_course_index.py +++ b/cms/djangoapps/contentstore/views/tests/test_course_index.py @@ -10,7 +10,6 @@ import pytz from django.conf import settings from django.core.exceptions import PermissionDenied -from django.test.utils import override_settings from django.utils.translation import ugettext as _ from contentstore.courseware_index import CoursewareSearchIndexer, SearchIndexingError diff --git a/cms/djangoapps/course_creators/tests/test_views.py b/cms/djangoapps/course_creators/tests/test_views.py index fca8e7faaa..9ece71c8a2 100644 --- a/cms/djangoapps/course_creators/tests/test_views.py +++ b/cms/djangoapps/course_creators/tests/test_views.py @@ -4,7 +4,7 @@ Tests course_creators.views.py. from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied -from django.test import TestCase, RequestFactory +from django.test import TestCase from django.core.urlresolvers import reverse from course_creators.views import add_user_with_status_unrequested, add_user_with_status_granted diff --git a/common/djangoapps/cache_toolbox/core.py b/common/djangoapps/cache_toolbox/core.py index 0122220d10..5d458f3e43 100644 --- a/common/djangoapps/cache_toolbox/core.py +++ b/common/djangoapps/cache_toolbox/core.py @@ -10,7 +10,6 @@ Core methods from django.core.cache import cache from django.db import DEFAULT_DB_ALIAS -from opaque_keys import InvalidKeyError from . import app_settings diff --git a/common/djangoapps/course_modes/tests/test_views.py b/common/djangoapps/course_modes/tests/test_views.py index 7ca8f6866b..67a84502f0 100644 --- a/common/djangoapps/course_modes/tests/test_views.py +++ b/common/djangoapps/course_modes/tests/test_views.py @@ -14,7 +14,6 @@ from django.conf import settings from django.core.urlresolvers import reverse from lms.djangoapps.commerce.tests import test_utils as ecomm_test_utils -from openedx.core.djangoapps.theming.tests import test_util as theming_test_utils from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.factories import CourseFactory diff --git a/common/djangoapps/embargo/tests/test_views.py b/common/djangoapps/embargo/tests/test_views.py index b4b6bb0749..0bc8f9ba62 100644 --- a/common/djangoapps/embargo/tests/test_views.py +++ b/common/djangoapps/embargo/tests/test_views.py @@ -4,7 +4,6 @@ import unittest from mock import patch from django.core.urlresolvers import reverse from django.conf import settings -from mako.exceptions import TopLevelLookupException import ddt from util.testing import UrlResetMixin diff --git a/common/djangoapps/embargo/views.py b/common/djangoapps/embargo/views.py index b97f21a860..fe311ea01a 100644 --- a/common/djangoapps/embargo/views.py +++ b/common/djangoapps/embargo/views.py @@ -2,7 +2,6 @@ from django.http import Http404 from django.views.generic.base import View -from django.conf import settings from edxmako.shortcuts import render_to_response diff --git a/common/djangoapps/enrollment/tests/test_api.py b/common/djangoapps/enrollment/tests/test_api.py index e5461d376b..f9cfe5a0a9 100644 --- a/common/djangoapps/enrollment/tests/test_api.py +++ b/common/djangoapps/enrollment/tests/test_api.py @@ -4,10 +4,8 @@ Tests for student enrollment. from mock import patch, Mock import ddt -from django.core.cache import cache from nose.tools import raises import unittest -from django.test import TestCase from django.test.utils import override_settings from django.conf import settings diff --git a/common/djangoapps/external_auth/tests/test_shib.py b/common/djangoapps/external_auth/tests/test_shib.py index 3c8a85ffd7..028766a106 100644 --- a/common/djangoapps/external_auth/tests/test_shib.py +++ b/common/djangoapps/external_auth/tests/test_shib.py @@ -23,7 +23,7 @@ from nose.plugins.attrib import attr from urllib import urlencode from openedx.core.djangolib.testing.utils import CacheIsolationTestCase -from student.views import create_account, change_enrollment +from student.views import change_enrollment from student.models import UserProfile, CourseEnrollment from student.tests.factories import UserFactory from xmodule.modulestore.tests.factories import CourseFactory diff --git a/common/djangoapps/student/tests/test_enrollment.py b/common/djangoapps/student/tests/test_enrollment.py index a4f71c68a6..acabe344c3 100644 --- a/common/djangoapps/student/tests/test_enrollment.py +++ b/common/djangoapps/student/tests/test_enrollment.py @@ -13,7 +13,7 @@ from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from util.testing import UrlResetMixin from embargo.test_utils import restrict_course -from student.tests.factories import UserFactory, CourseModeFactory, CourseEnrollmentFactory +from student.tests.factories import UserFactory, CourseModeFactory from student.models import CourseEnrollment, CourseFullError from student.roles import ( CourseInstructorRole, diff --git a/common/djangoapps/student/tests/test_reset_password.py b/common/djangoapps/student/tests/test_reset_password.py index 6b3b61ed58..0bef3d29a7 100644 --- a/common/djangoapps/student/tests/test_reset_password.py +++ b/common/djangoapps/student/tests/test_reset_password.py @@ -13,8 +13,7 @@ from django.contrib.auth.models import User from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX from django.contrib.auth.tokens import default_token_generator -from django.utils.encoding import force_bytes, force_text -from django.utils.http import urlsafe_base64_encode, base36_to_int, int_to_base36 +from django.utils.http import int_to_base36 from mock import Mock, patch import ddt diff --git a/common/djangoapps/student/tests/test_user_profile_properties.py b/common/djangoapps/student/tests/test_user_profile_properties.py index ace966e726..7649859ce8 100644 --- a/common/djangoapps/student/tests/test_user_profile_properties.py +++ b/common/djangoapps/student/tests/test_user_profile_properties.py @@ -2,7 +2,6 @@ import datetime import ddt -from django.test import TestCase from student.models import UserProfile from student.tests.factories import UserFactory diff --git a/common/djangoapps/xblock_django/api.py b/common/djangoapps/xblock_django/api.py index 1173ade5c2..a316740c94 100644 --- a/common/djangoapps/xblock_django/api.py +++ b/common/djangoapps/xblock_django/api.py @@ -1,7 +1,8 @@ """ API methods related to xblock state. """ -from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConfigurationFlag + +from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration def deprecated_xblocks(): diff --git a/common/djangoapps/xblock_django/models.py b/common/djangoapps/xblock_django/models.py index 5233459550..d0f578a6e6 100644 --- a/common/djangoapps/xblock_django/models.py +++ b/common/djangoapps/xblock_django/models.py @@ -1,12 +1,9 @@ """ Models. """ -from django.utils.translation import ugettext_lazy as _ -from django.conf import settings - -from django.db.models import TextField from django.db import models +from django.utils.translation import ugettext_lazy as _ from config_models.models import ConfigurationModel diff --git a/common/lib/xmodule/xmodule/modulestore/tests/django_utils.py b/common/lib/xmodule/xmodule/modulestore/tests/django_utils.py index 2a9af55ce8..c80317d4d7 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/django_utils.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/django_utils.py @@ -5,12 +5,10 @@ Modulestore configuration for test cases. import copy import functools import os -from uuid import uuid4 from contextlib import contextmanager from mock import patch -import django.core.cache from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py index 8b08d009a8..43dbdd18ee 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py @@ -28,7 +28,6 @@ from xmodule.modulestore.edit_info import EditInfoMixin from xmodule.modulestore.inheritance import InheritanceMixin from xmodule.modulestore.tests.utils import MongoContentstoreBuilder from xmodule.contentstore.content import StaticContent -from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.xml_importer import import_course_from_xml from xmodule.modulestore.xml_exporter import export_course_to_xml from xmodule.modulestore.tests.test_asides import AsideTestType diff --git a/common/test/acceptance/tests/lms/test_learner_profile.py b/common/test/acceptance/tests/lms/test_learner_profile.py index 9699c223db..0c24cbe4cb 100644 --- a/common/test/acceptance/tests/lms/test_learner_profile.py +++ b/common/test/acceptance/tests/lms/test_learner_profile.py @@ -6,7 +6,6 @@ from contextlib import contextmanager from bok_choy.web_app_test import WebAppTest from datetime import datetime -from flaky import flaky from nose.plugins.attrib import attr from common.test.acceptance.pages.common.logout import LogoutPage diff --git a/common/test/acceptance/tests/lms/test_oauth2.py b/common/test/acceptance/tests/lms/test_oauth2.py index b3b3a25647..2d7b852b81 100644 --- a/common/test/acceptance/tests/lms/test_oauth2.py +++ b/common/test/acceptance/tests/lms/test_oauth2.py @@ -4,8 +4,6 @@ from common.test.acceptance.pages.lms.oauth2_confirmation import OAuth2Confirmat from common.test.acceptance.pages.lms.auto_auth import AutoAuthPage from bok_choy.web_app_test import WebAppTest -from flaky import flaky - from urlparse import urlparse, parse_qsl diff --git a/lms/djangoapps/branding/tests/test_page.py b/lms/djangoapps/branding/tests/test_page.py index f99fd22de5..b5f21850b3 100644 --- a/lms/djangoapps/branding/tests/test_page.py +++ b/lms/djangoapps/branding/tests/test_page.py @@ -16,7 +16,6 @@ from nose.plugins.attrib import attr from edxmako.shortcuts import render_to_response from branding.views import index -import student.views from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory diff --git a/lms/djangoapps/bulk_email/forms.py b/lms/djangoapps/bulk_email/forms.py index 32d91443c5..8b4ebb6c63 100644 --- a/lms/djangoapps/bulk_email/forms.py +++ b/lms/djangoapps/bulk_email/forms.py @@ -9,7 +9,6 @@ from django.core.exceptions import ValidationError from bulk_email.models import CourseEmailTemplate, COURSE_EMAIL_MESSAGE_BODY_TAG, CourseAuthorization from opaque_keys import InvalidKeyError -from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.locations import SlashSeparatedCourseKey diff --git a/lms/djangoapps/bulk_email/models.py b/lms/djangoapps/bulk_email/models.py index 6d45fed467..1beceaa54f 100644 --- a/lms/djangoapps/bulk_email/models.py +++ b/lms/djangoapps/bulk_email/models.py @@ -4,7 +4,6 @@ Models for bulk email import logging import markupsafe -from django.conf import settings from django.contrib.auth.models import User from django.db import models diff --git a/lms/djangoapps/bulk_email/tasks.py b/lms/djangoapps/bulk_email/tasks.py index ac5475d213..9b89c58533 100644 --- a/lms/djangoapps/bulk_email/tasks.py +++ b/lms/djangoapps/bulk_email/tasks.py @@ -36,12 +36,9 @@ from django.core.mail import EmailMultiAlternatives, get_connection from django.core.mail.message import forbid_multi_line_headers from django.core.urlresolvers import reverse -from bulk_email.models import ( - CourseEmail, Optout, Target -) +from bulk_email.models import CourseEmail, Optout from courseware.courses import get_course from openedx.core.lib.courses import course_image_url -from student.roles import CourseStaffRole, CourseInstructorRole from instructor_task.models import InstructorTask from instructor_task.subtasks import ( SubtaskStatus, @@ -49,7 +46,6 @@ from instructor_task.subtasks import ( check_subtask_is_valid, update_subtask_status, ) -from util.query import use_read_replica_if_available from util.date_utils import get_default_time_display from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers diff --git a/lms/djangoapps/bulk_email/tests/test_course_optout.py b/lms/djangoapps/bulk_email/tests/test_course_optout.py index d70db462f9..e061a1ea68 100644 --- a/lms/djangoapps/bulk_email/tests/test_course_optout.py +++ b/lms/djangoapps/bulk_email/tests/test_course_optout.py @@ -9,7 +9,6 @@ from nose.plugins.attrib import attr from django.core import mail from django.core.management import call_command from django.core.urlresolvers import reverse -from django.conf import settings from student.tests.factories import UserFactory, AdminFactory, CourseEnrollmentFactory from student.models import CourseEnrollment diff --git a/lms/djangoapps/bulk_email/tests/test_email.py b/lms/djangoapps/bulk_email/tests/test_email.py index 062da01ad9..cd20d9a3fd 100644 --- a/lms/djangoapps/bulk_email/tests/test_email.py +++ b/lms/djangoapps/bulk_email/tests/test_email.py @@ -9,7 +9,6 @@ from nose.plugins.attrib import attr import os from unittest import skipIf -from django.conf import settings from django.core import mail from django.core.mail.message import forbid_multi_line_headers from django.core.urlresolvers import reverse diff --git a/lms/djangoapps/bulk_email/tests/test_forms.py b/lms/djangoapps/bulk_email/tests/test_forms.py index d70cdc5be6..b823acc44e 100644 --- a/lms/djangoapps/bulk_email/tests/test_forms.py +++ b/lms/djangoapps/bulk_email/tests/test_forms.py @@ -2,7 +2,7 @@ """ Unit tests for bulk-email-related forms. """ -from django.conf import settings + from nose.plugins.attrib import attr from bulk_email.models import CourseEmailTemplate, BulkEmailFlag @@ -10,8 +10,6 @@ from bulk_email.forms import CourseAuthorizationAdminForm, CourseEmailTemplateFo from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory -from xmodule.modulestore.django import modulestore -from xmodule.modulestore import ModuleStoreEnum @attr('shard_1') diff --git a/lms/djangoapps/bulk_email/tests/test_models.py b/lms/djangoapps/bulk_email/tests/test_models.py index fd37b9a59c..db3fd2b591 100644 --- a/lms/djangoapps/bulk_email/tests/test_models.py +++ b/lms/djangoapps/bulk_email/tests/test_models.py @@ -3,7 +3,6 @@ Unit tests for bulk-email-related models. """ from django.test import TestCase from django.core.management import call_command -from django.conf import settings from student.tests.factories import UserFactory diff --git a/lms/djangoapps/ccx/utils.py b/lms/djangoapps/ccx/utils.py index 943c992349..66170ddd6c 100644 --- a/lms/djangoapps/ccx/utils.py +++ b/lms/djangoapps/ccx/utils.py @@ -16,8 +16,6 @@ from django.core.urlresolvers import reverse from smtplib import SMTPException from courseware.courses import get_course_by_id -from courseware.model_data import FieldDataCache -from courseware.module_render import get_module_for_descriptor from instructor.enrollment import ( enroll_email, get_email_params, diff --git a/lms/djangoapps/certificates/tests/test_views.py b/lms/djangoapps/certificates/tests/test_views.py index 9966c69018..b4f0c9b2e4 100644 --- a/lms/djangoapps/certificates/tests/test_views.py +++ b/lms/djangoapps/certificates/tests/test_views.py @@ -7,7 +7,6 @@ import ddt from django.conf import settings from django.core.cache import cache from django.core.urlresolvers import reverse -from django.test import TestCase from django.test.client import Client from django.test.utils import override_settings from nose.plugins.attrib import attr diff --git a/lms/djangoapps/courseware/courses.py b/lms/djangoapps/courseware/courses.py index e932089ef4..d75cdb52f8 100644 --- a/lms/djangoapps/courseware/courses.py +++ b/lms/djangoapps/courseware/courses.py @@ -13,7 +13,6 @@ from django.http import Http404 from django.conf import settings from edxmako.shortcuts import render_to_string -from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.exceptions import ItemNotFoundError from static_replace import replace_static_urls diff --git a/lms/djangoapps/courseware/tests/test_about.py b/lms/djangoapps/courseware/tests/test_about.py index 5530cd9dcc..d2b6e26ae3 100644 --- a/lms/djangoapps/courseware/tests/test_about.py +++ b/lms/djangoapps/courseware/tests/test_about.py @@ -10,7 +10,6 @@ from django.core.urlresolvers import reverse from django.test.utils import override_settings from mock import patch from nose.plugins.attrib import attr -from opaque_keys.edx.locations import SlashSeparatedCourseKey from course_modes.models import CourseMode from track.tests import EventTrackingTestCase diff --git a/lms/djangoapps/courseware/tests/test_access.py b/lms/djangoapps/courseware/tests/test_access.py index 26338cd091..1fba0b5082 100644 --- a/lms/djangoapps/courseware/tests/test_access.py +++ b/lms/djangoapps/courseware/tests/test_access.py @@ -9,7 +9,6 @@ import pytz from django.contrib.auth.models import User from ccx_keys.locator import CCXLocator -from django.http import Http404 from django.test.client import RequestFactory from django.core.urlresolvers import reverse from django.test import TestCase @@ -28,7 +27,6 @@ from courseware.tests.factories import ( StaffFactory, UserFactory, ) -import courseware.views.views as views from courseware.tests.helpers import LoginEnrollmentTestCase from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from student.models import CourseEnrollment diff --git a/lms/djangoapps/courseware/tests/test_course_info.py b/lms/djangoapps/courseware/tests/test_course_info.py index 92b574e75a..acb4628763 100644 --- a/lms/djangoapps/courseware/tests/test_course_info.py +++ b/lms/djangoapps/courseware/tests/test_course_info.py @@ -10,7 +10,6 @@ from ccx_keys.locator import CCXLocator from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings -from opaque_keys.edx.locations import SlashSeparatedCourseKey from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration from util.date_utils import strftime_localized diff --git a/lms/djangoapps/courseware/tests/test_courses.py b/lms/djangoapps/courseware/tests/test_courses.py index 304d84390f..9215161118 100644 --- a/lms/djangoapps/courseware/tests/test_courses.py +++ b/lms/djangoapps/courseware/tests/test_courses.py @@ -11,7 +11,6 @@ from django.core.urlresolvers import reverse from django.test.client import RequestFactory import mock from nose.plugins.attrib import attr -from opaque_keys.edx.locations import SlashSeparatedCourseKey from courseware.courses import ( get_cms_block_link, diff --git a/lms/djangoapps/courseware/tests/test_favicon.py b/lms/djangoapps/courseware/tests/test_favicon.py index ecf3f0b70d..bdbbe2fe53 100644 --- a/lms/djangoapps/courseware/tests/test_favicon.py +++ b/lms/djangoapps/courseware/tests/test_favicon.py @@ -1,14 +1,8 @@ -from django.conf import settings -from django.core.urlresolvers import clear_url_caches, resolve - from django.test import TestCase from django.test.utils import override_settings -from mock import patch from nose.plugins.attrib import attr -import sys - from util.testing import UrlResetMixin diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index c3b072cb9b..c96a809e1f 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -45,7 +45,7 @@ from courseware.testutils import RenderXBlockTestMixin from courseware.tests.factories import StudentModuleFactory, GlobalStaffFactory from courseware.url_helpers import get_redirect_url from courseware.user_state_client import DjangoXBlockUserStateClient -from courseware.views.index import render_accordion, CoursewareIndex +from courseware.views.index import render_accordion from lms.djangoapps.commerce.utils import EcommerceService # pylint: disable=import-error from milestones.tests.utils import MilestonesTestCaseMixin from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration diff --git a/lms/djangoapps/courseware/views/views.py b/lms/djangoapps/courseware/views/views.py index 157ca566f9..8562c55156 100644 --- a/lms/djangoapps/courseware/views/views.py +++ b/lms/djangoapps/courseware/views/views.py @@ -63,7 +63,7 @@ from courseware.courses import ( UserNotEnrolled ) from courseware.masquerade import setup_masquerade -from courseware.model_data import FieldDataCache, ScoresClient +from courseware.model_data import FieldDataCache from courseware.models import StudentModule, BaseStudentModuleHistory from courseware.url_helpers import get_redirect_url, get_redirect_url_for_global_staff from courseware.user_state_client import DjangoXBlockUserStateClient diff --git a/lms/djangoapps/dashboard/sysadmin.py b/lms/djangoapps/dashboard/sysadmin.py index d8144107e8..6ed90d5e4a 100644 --- a/lms/djangoapps/dashboard/sysadmin.py +++ b/lms/djangoapps/dashboard/sysadmin.py @@ -7,7 +7,6 @@ import json import logging import os import subprocess -import time import StringIO from django.conf import settings @@ -39,7 +38,6 @@ from external_auth.models import ExternalAuthMap from external_auth.views import generate_password from student.models import CourseEnrollment, UserProfile, Registration import track.views -from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from opaque_keys.edx.locations import SlashSeparatedCourseKey diff --git a/lms/djangoapps/debug/views.py b/lms/djangoapps/debug/views.py index 7784c6b0a7..6a75a45fbc 100644 --- a/lms/djangoapps/debug/views.py +++ b/lms/djangoapps/debug/views.py @@ -3,7 +3,7 @@ import pprint import traceback -from django.http import Http404, HttpResponse, HttpResponseNotFound +from django.http import Http404, HttpResponse from django.contrib.auth.decorators import login_required from django.utils.html import escape @@ -12,8 +12,6 @@ from edxmako.shortcuts import render_to_response from codejail.safe_exec import safe_exec -from mako.exceptions import TopLevelLookupException - @login_required @ensure_csrf_cookie diff --git a/lms/djangoapps/discussion_api/tests/test_api.py b/lms/djangoapps/discussion_api/tests/test_api.py index e3b374bb13..323b02dccd 100644 --- a/lms/djangoapps/discussion_api/tests/test_api.py +++ b/lms/djangoapps/discussion_api/tests/test_api.py @@ -41,7 +41,6 @@ from discussion_api.tests.utils import ( make_minimal_cs_comment, make_minimal_cs_thread, make_paginated_api_response, - ProfileImageTestMixin, ) from django_comment_common.models import ( FORUM_ROLE_ADMINISTRATOR, diff --git a/lms/djangoapps/discussion_api/tests/test_serializers.py b/lms/djangoapps/discussion_api/tests/test_serializers.py index 04d7d9ec24..6e269e2638 100644 --- a/lms/djangoapps/discussion_api/tests/test_serializers.py +++ b/lms/djangoapps/discussion_api/tests/test_serializers.py @@ -16,7 +16,6 @@ from discussion_api.tests.utils import ( CommentsServiceMockMixin, make_minimal_cs_thread, make_minimal_cs_comment, - ProfileImageTestMixin, ) from django_comment_common.models import ( FORUM_ROLE_ADMINISTRATOR, diff --git a/lms/djangoapps/django_comment_client/base/tests.py b/lms/djangoapps/django_comment_client/base/tests.py index 3b3f3ebd6e..1d9d41fabe 100644 --- a/lms/djangoapps/django_comment_client/base/tests.py +++ b/lms/djangoapps/django_comment_client/base/tests.py @@ -4,8 +4,6 @@ import logging import json import ddt -from django.conf import settings -from django.core.cache import caches from django.test.client import RequestFactory from django.contrib.auth.models import User from django.core.management import call_command diff --git a/lms/djangoapps/django_comment_client/tests/test_utils.py b/lms/djangoapps/django_comment_client/tests/test_utils.py index 968beb4025..ea72e272a4 100644 --- a/lms/djangoapps/django_comment_client/tests/test_utils.py +++ b/lms/djangoapps/django_comment_client/tests/test_utils.py @@ -28,7 +28,6 @@ from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, ToyCourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_MODULESTORE from xmodule.modulestore.django import modulestore -from opaque_keys.edx.locator import CourseLocator from lms.djangoapps.teams.tests.factories import CourseTeamFactory diff --git a/lms/djangoapps/instructor/tests/test_api.py b/lms/djangoapps/instructor/tests/test_api.py index 22cefc03e2..d4e024a1c1 100644 --- a/lms/djangoapps/instructor/tests/test_api.py +++ b/lms/djangoapps/instructor/tests/test_api.py @@ -11,7 +11,6 @@ import io import json import shutil import tempfile -from urllib import quote from django.conf import settings from django.contrib.auth.models import User diff --git a/lms/djangoapps/instructor/tests/test_email.py b/lms/djangoapps/instructor/tests/test_email.py index e48121c943..7daff9fa33 100644 --- a/lms/djangoapps/instructor/tests/test_email.py +++ b/lms/djangoapps/instructor/tests/test_email.py @@ -4,7 +4,7 @@ Additionally tests that bulk email is always disabled for non-Mongo backed courses, regardless of email feature flag, and that the view is conditionally available when Course Auth is turned on. """ -from django.conf import settings + from django.core.urlresolvers import reverse from nose.plugins.attrib import attr from opaque_keys.edx.locations import SlashSeparatedCourseKey diff --git a/lms/djangoapps/instructor/views/tools.py b/lms/djangoapps/instructor/views/tools.py index bc821dd710..9d6daa511d 100644 --- a/lms/djangoapps/instructor/views/tools.py +++ b/lms/djangoapps/instructor/views/tools.py @@ -4,7 +4,6 @@ Tools for the instructor dashboard import dateutil import json -from django.conf import settings from django.contrib.auth.models import User from django.http import HttpResponseBadRequest from django.utils.timezone import utc @@ -18,8 +17,6 @@ from courseware.student_field_overrides import ( override_field_for_user, ) from xmodule.fields import Date -from xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.django import modulestore from opaque_keys.edx.keys import UsageKey DATE_FIELD = Date() diff --git a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py index f57415eda9..27d1177fed 100644 --- a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py +++ b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py @@ -18,7 +18,6 @@ from freezegun import freeze_time from mock import Mock, patch from nose.plugins.attrib import attr import tempfile -from openedx.core.djangoapps.course_groups import cohorts import unicodecsv from django.core.urlresolvers import reverse from django.test.utils import override_settings diff --git a/lms/djangoapps/mobile_api/tests/test_middleware.py b/lms/djangoapps/mobile_api/tests/test_middleware.py index 86a675e495..d2e26ed776 100644 --- a/lms/djangoapps/mobile_api/tests/test_middleware.py +++ b/lms/djangoapps/mobile_api/tests/test_middleware.py @@ -3,9 +3,8 @@ Tests for Version Based App Upgrade Middleware """ from datetime import datetime import ddt -from django.core.cache import cache, caches +from django.core.cache import caches from django.http import HttpRequest, HttpResponse -from django.test import TestCase import mock from pytz import UTC from mobile_api.middleware import AppVersionUpgrade diff --git a/lms/djangoapps/oauth_dispatch/views.py b/lms/djangoapps/oauth_dispatch/views.py index 85a27acc87..385cd7f46f 100644 --- a/lms/djangoapps/oauth_dispatch/views.py +++ b/lms/djangoapps/oauth_dispatch/views.py @@ -6,12 +6,8 @@ django-oauth-toolkit as appropriate. from __future__ import unicode_literals import json -from time import time -import jwt from auth_exchange import views as auth_exchange_views -from django.conf import settings -from django.utils.functional import cached_property from django.views.generic import View from edx_oauth2_provider import views as dop_views # django-oauth2-provider views from oauth2_provider import models as dot_models, views as dot_views # django-oauth-toolkit diff --git a/lms/djangoapps/verify_student/tests/test_models.py b/lms/djangoapps/verify_student/tests/test_models.py index 32ce788484..c6a57efccf 100644 --- a/lms/djangoapps/verify_student/tests/test_models.py +++ b/lms/djangoapps/verify_student/tests/test_models.py @@ -6,7 +6,6 @@ import boto import ddt from django.conf import settings from django.db import IntegrityError -from django.test import TestCase from freezegun import freeze_time import mock from mock import patch diff --git a/lms/startup.py b/lms/startup.py index b6b8bab768..b4eefcb3fc 100644 --- a/lms/startup.py +++ b/lms/startup.py @@ -10,7 +10,6 @@ from django.conf import settings settings.INSTALLED_APPS # pylint: disable=pointless-statement from openedx.core.lib.django_startup import autostartup -import edxmako import logging import analytics from monkey_patch import ( diff --git a/openedx/core/djangoapps/common_views/xblock.py b/openedx/core/djangoapps/common_views/xblock.py index 510abdcc8d..4062208d61 100644 --- a/openedx/core/djangoapps/common_views/xblock.py +++ b/openedx/core/djangoapps/common_views/xblock.py @@ -5,7 +5,6 @@ from __future__ import absolute_import import logging import mimetypes -import pkg_resources from xblock.core import XBlock diff --git a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py index b6b1971747..68b5672ea6 100644 --- a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py +++ b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py @@ -17,7 +17,6 @@ from xmodule.partitions.partitions import Group, UserPartition, UserPartitionErr from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_MODULESTORE from xmodule.modulestore.tests.factories import ToyCourseFactory -from opaque_keys.edx.locations import SlashSeparatedCourseKey from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme from ..partition_scheme import CohortPartitionScheme, get_cohorted_user_partition diff --git a/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py b/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py index 8f4e912303..e6bbad5f7f 100644 --- a/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py +++ b/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py @@ -5,7 +5,7 @@ import unittest from django.conf import settings from django.core.urlresolvers import reverse -from django.test import TestCase, override_settings +from django.test import TestCase from django.contrib import staticfiles from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme diff --git a/openedx/core/djangoapps/user_api/accounts/views.py b/openedx/core/djangoapps/user_api/accounts/views.py index e9d537f7c9..a95a1b6646 100644 --- a/openedx/core/djangoapps/user_api/accounts/views.py +++ b/openedx/core/djangoapps/user_api/accounts/views.py @@ -9,7 +9,6 @@ from edx_rest_framework_extensions.authentication import JwtAuthentication from rest_framework import permissions from rest_framework import status from rest_framework.response import Response -from rest_framework.views import APIView from rest_framework.viewsets import ViewSet from openedx.core.lib.api.authentication import ( diff --git a/openedx/core/djangolib/js_utils.py b/openedx/core/djangolib/js_utils.py index ce0c94d7ae..b8356dbdac 100644 --- a/openedx/core/djangolib/js_utils.py +++ b/openedx/core/djangolib/js_utils.py @@ -5,7 +5,6 @@ import json from django.utils.html import escapejs from mako.filters import decode -from markupsafe import escape from xmodule.modulestore import EdxJSONEncoder diff --git a/openedx/core/lib/courses.py b/openedx/core/lib/courses.py index 77f3920b10..193eb53764 100644 --- a/openedx/core/lib/courses.py +++ b/openedx/core/lib/courses.py @@ -6,8 +6,6 @@ from django.conf import settings from xmodule.assetstore.assetmgr import AssetManager from xmodule.contentstore.content import StaticContent from xmodule.contentstore.django import contentstore -from xmodule.modulestore.django import modulestore -from xmodule.modulestore import ModuleStoreEnum def course_image_url(course, image_key='course_image'): diff --git a/openedx/core/lib/django_require/staticstorage.py b/openedx/core/lib/django_require/staticstorage.py index 6353072795..2e068055b6 100644 --- a/openedx/core/lib/django_require/staticstorage.py +++ b/openedx/core/lib/django_require/staticstorage.py @@ -2,7 +2,6 @@ :class:`~django_require.staticstorage.OptimizedCachedRequireJsStorage` """ -from pipeline.storage import PipelineCachedStorage from require.storage import OptimizedFilesMixin from django_pipeline_forgiving.storages import PipelineForgivingStorage diff --git a/openedx/core/lib/gating/tests/test_api.py b/openedx/core/lib/gating/tests/test_api.py index e88bd3fb57..35826329a2 100644 --- a/openedx/core/lib/gating/tests/test_api.py +++ b/openedx/core/lib/gating/tests/test_api.py @@ -1,7 +1,8 @@ """ Tests for the gating API """ -from mock import patch, MagicMock + +from mock import patch from nose.plugins.attrib import attr from ddt import ddt, data from milestones.tests.utils import MilestonesTestCaseMixin diff --git a/openedx/core/lib/tests/test_edx_api_utils.py b/openedx/core/lib/tests/test_edx_api_utils.py index df050ca1b4..a81d300b12 100644 --- a/openedx/core/lib/tests/test_edx_api_utils.py +++ b/openedx/core/lib/tests/test_edx_api_utils.py @@ -1,6 +1,5 @@ """Tests covering edX API utilities.""" import json -import unittest from django.core.cache import cache from django.test.utils import override_settings diff --git a/openedx/core/lib/xblock_utils.py b/openedx/core/lib/xblock_utils.py index 96060f57e5..757230053c 100644 --- a/openedx/core/lib/xblock_utils.py +++ b/openedx/core/lib/xblock_utils.py @@ -26,8 +26,6 @@ from xblock.fragment import Fragment from xmodule.seq_module import SequenceModule from xmodule.vertical_block import VerticalBlock from xmodule.x_module import shim_xmodule_js, XModuleDescriptor, XModule, PREVIEW_VIEWS, STUDIO_VIEW -from xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.django import modulestore log = logging.getLogger(__name__) diff --git a/pavelib/tests.py b/pavelib/tests.py index ffcf7668fe..f2b38af012 100644 --- a/pavelib/tests.py +++ b/pavelib/tests.py @@ -4,7 +4,7 @@ Unit test tasks import re import os import sys -from paver.easy import sh, task, cmdopts, needs, call_task +from paver.easy import sh, task, cmdopts, needs from pavelib.utils.test import suites from pavelib.utils.envs import Env from pavelib.utils.passthrough_opts import PassthroughTask