From ba8fd1c21daeb6a62f46d0b7bf57d83511a17906 Mon Sep 17 00:00:00 2001 From: Sarina Canelake Date: Fri, 10 Jul 2015 10:35:42 -0400 Subject: [PATCH] Eliminate instances of `unused-import` Pylint violation --- .../contentstore/features/checklists.py | 1 - .../contentstore/features/course-outline.py | 2 +- .../contentstore/features/course-settings.py | 3 +-- .../contentstore/features/grading.py | 2 +- cms/djangoapps/contentstore/views/library.py | 1 - cms/djangoapps/contentstore/views/preview.py | 1 - cms/djangoapps/contentstore/views/tabs.py | 1 - common/djangoapps/external_auth/views.py | 2 +- common/djangoapps/monitoring/startup.py | 2 +- .../djangoapps/performance/tests/test_logs.py | 2 -- common/djangoapps/student/helpers.py | 6 +---- common/djangoapps/student/tests/test_email.py | 4 ++-- .../tests/test_login_registration_forms.py | 2 -- .../student/tests/test_verification_status.py | 2 +- common/djangoapps/student/tests/tests.py | 10 +++++---- common/djangoapps/student/views.py | 9 ++------ .../djangoapps/third_party_auth/pipeline.py | 3 --- .../third_party_auth/tests/specs/base.py | 1 - .../tests/specs/test_google.py | 1 - .../tests/specs/test_linkedin.py | 1 - .../third_party_auth/tests/test_pipeline.py | 2 +- common/djangoapps/track/models.py | 1 + .../track/views/tests/test_views.py | 4 ---- common/lib/safe_lxml/safe_lxml/etree.py | 2 +- .../lib/xmodule/xmodule/discussion_module.py | 1 - .../xmodule/modulestore/tests/factories.py | 4 +--- .../tests/test_mixed_modulestore.py | 1 - .../modulestore/tests/test_xml_importer.py | 1 - .../xmodule/video_module/video_xfields.py | 1 - common/lib/xmodule/xmodule/wrapper_module.py | 1 - common/test/acceptance/pages/lms/dashboard.py | 1 - .../test/acceptance/pages/lms/find_courses.py | 1 - .../acceptance/pages/lms/pay_and_verify.py | 5 ++--- .../acceptance/pages/lms/track_selection.py | 6 +---- .../test/acceptance/pages/studio/overview.py | 1 - .../performance/test_lms_performance.py | 2 +- common/test/acceptance/tests/lms/test_lms.py | 1 - .../tests/lms/test_lms_course_discovery.py | 2 -- .../tests/lms/test_lms_courseware_search.py | 1 - .../acceptance/tests/lms/test_lms_edxnotes.py | 4 +++- .../tests/lms/test_lms_user_preview.py | 1 - .../tests/studio/test_studio_home.py | 1 - .../tests/studio/test_studio_library.py | 1 - .../tests/studio/test_studio_settings.py | 1 - .../tests/studio/test_studio_split_test.py | 1 - .../test/acceptance/tests/test_annotatable.py | 3 --- lms/djangoapps/ccx/views.py | 22 +++++++++---------- lms/djangoapps/commerce/urls.py | 2 +- lms/djangoapps/courseware/features/gst.py | 3 +-- lms/djangoapps/courseware/features/video.py | 2 +- .../courseware/features/word_cloud.py | 3 --- lms/djangoapps/courseware/views.py | 1 - lms/djangoapps/discussion_api/forms.py | 1 - .../django_comment_client/forum/tests.py | 1 - .../django_comment_client/permissions.py | 1 - .../instructor_task/tests/test_integration.py | 9 +++++--- lms/djangoapps/lti_provider/views.py | 3 --- .../mobile_api/course_info/views.py | 2 +- .../mobile_api/users/serializers.py | 1 - .../shoppingcart/tests/test_views.py | 1 - lms/djangoapps/shoppingcart/views.py | 1 - .../student_account/test/test_views.py | 4 +--- lms/djangoapps/student_profile/views.py | 2 -- lms/djangoapps/verify_student/models.py | 2 +- .../verify_student/tests/test_models.py | 3 +-- .../verify_student/tests/test_views.py | 4 +--- .../courseware_search/lms_result_processor.py | 2 -- lms/tests.py | 1 - lms/urls.py | 1 - .../tests/test_partition_scheme.py | 5 ++--- .../core/djangoapps/course_groups/views.py | 2 +- openedx/core/djangoapps/user_api/forms.py | 1 + .../tests/test_email_opt_in_list.py | 5 +---- openedx/core/djangoapps/user_api/models.py | 2 +- .../djangoapps/user_api/tests/test_models.py | 5 +++-- .../test_paver_get_quality_reports.py | 11 ++++------ pavelib/tests.py | 2 +- pavelib/utils/test/suites/nose_suite.py | 1 - 78 files changed, 66 insertions(+), 146 deletions(-) diff --git a/cms/djangoapps/contentstore/features/checklists.py b/cms/djangoapps/contentstore/features/checklists.py index aad13a3120..43945658fb 100644 --- a/cms/djangoapps/contentstore/features/checklists.py +++ b/cms/djangoapps/contentstore/features/checklists.py @@ -3,7 +3,6 @@ from lettuce import world, step from nose.tools import assert_true, assert_equal # pylint: disable=no-name-in-module -from terrain.steps import reload_the_page from selenium.common.exceptions import StaleElementReferenceException diff --git a/cms/djangoapps/contentstore/features/course-outline.py b/cms/djangoapps/contentstore/features/course-outline.py index 17c71b85e5..6ab7f85e81 100644 --- a/cms/djangoapps/contentstore/features/course-outline.py +++ b/cms/djangoapps/contentstore/features/course-outline.py @@ -3,7 +3,7 @@ from lettuce import world, step from common import * -from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=no-name-in-module +from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module from logging import getLogger logger = getLogger(__name__) diff --git a/cms/djangoapps/contentstore/features/course-settings.py b/cms/djangoapps/contentstore/features/course-settings.py index c2aaae4989..7970a0e1f2 100644 --- a/cms/djangoapps/contentstore/features/course-settings.py +++ b/cms/djangoapps/contentstore/features/course-settings.py @@ -2,12 +2,11 @@ # pylint: disable=redefined-outer-name from lettuce import world, step -from terrain.steps import reload_the_page from selenium.webdriver.common.keys import Keys from common import type_in_codemirror, upload_file from django.conf import settings -from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=no-name-in-module +from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module TEST_ROOT = settings.COMMON_TEST_DATA_ROOT diff --git a/cms/djangoapps/contentstore/features/grading.py b/cms/djangoapps/contentstore/features/grading.py index 569f39d609..04ef1e1dd3 100644 --- a/cms/djangoapps/contentstore/features/grading.py +++ b/cms/djangoapps/contentstore/features/grading.py @@ -6,7 +6,7 @@ from common import * from terrain.steps import reload_the_page from selenium.common.exceptions import InvalidElementStateException from contentstore.utils import reverse_course_url -from nose.tools import assert_in, assert_not_in, assert_equal, assert_not_equal # pylint: disable=no-name-in-module +from nose.tools import assert_in, assert_equal, assert_not_equal # pylint: disable=no-name-in-module @step(u'I am viewing the grading settings') diff --git a/cms/djangoapps/contentstore/views/library.py b/cms/djangoapps/contentstore/views/library.py index 7d0fcf63ba..1323aa4f09 100644 --- a/cms/djangoapps/contentstore/views/library.py +++ b/cms/djangoapps/contentstore/views/library.py @@ -31,7 +31,6 @@ from student.auth import ( STUDIO_VIEW_USERS, STUDIO_EDIT_ROLES, get_user_permissions, has_studio_read_access, has_studio_write_access ) from student.roles import CourseInstructorRole, CourseStaffRole, LibraryUserRole -from student import auth from util.json_request import expect_json, JsonResponse, JsonResponseBadRequest __all__ = ['library_handler', 'manage_library_users'] diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index d23c4476e1..6e5d6dc768 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -19,7 +19,6 @@ from xmodule.services import SettingsService from xmodule.modulestore.django import modulestore, ModuleI18nService from xmodule.mixin import wrap_with_license from opaque_keys.edx.keys import UsageKey -from opaque_keys.edx.locator import LibraryUsageLocator from xmodule.x_module import ModuleSystem from xblock.runtime import KvsFieldData from xblock.django.request import webob_to_django_response, django_to_webob_request diff --git a/cms/djangoapps/contentstore/views/tabs.py b/cms/djangoapps/contentstore/views/tabs.py index 9a2d173f03..f79d4d0721 100644 --- a/cms/djangoapps/contentstore/views/tabs.py +++ b/cms/djangoapps/contentstore/views/tabs.py @@ -5,7 +5,6 @@ from student.auth import has_course_author_access from util.json_request import expect_json, JsonResponse from django.http import HttpResponseNotFound -from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.views.decorators.csrf import ensure_csrf_cookie diff --git a/common/djangoapps/external_auth/views.py b/common/djangoapps/external_auth/views.py index df7391bf95..1d6655f499 100644 --- a/common/djangoapps/external_auth/views.py +++ b/common/djangoapps/external_auth/views.py @@ -25,7 +25,7 @@ if settings.FEATURES.get('AUTH_USE_CAS'): from student.helpers import get_next_url_for_login_page from student.models import UserProfile -from django.http import HttpResponse, HttpResponseRedirect, HttpRequest, HttpResponseForbidden +from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden from django.utils.http import urlquote, is_safe_url from django.shortcuts import redirect from django.utils.translation import ugettext as _ diff --git a/common/djangoapps/monitoring/startup.py b/common/djangoapps/monitoring/startup.py index fca7648868..9da82409a0 100644 --- a/common/djangoapps/monitoring/startup.py +++ b/common/djangoapps/monitoring/startup.py @@ -1,4 +1,4 @@ # Register signal handlers -# pylint: disable=unused-imports +# pylint: disable=unused-import import signals import exceptions diff --git a/common/djangoapps/performance/tests/test_logs.py b/common/djangoapps/performance/tests/test_logs.py index 7a80f73239..2bd0ce9999 100644 --- a/common/djangoapps/performance/tests/test_logs.py +++ b/common/djangoapps/performance/tests/test_logs.py @@ -2,8 +2,6 @@ import datetime import dateutil import json -import mock -import unittest import logging from StringIO import StringIO diff --git a/common/djangoapps/student/helpers.py b/common/djangoapps/student/helpers.py index 85c2b6def0..e5678ca5cd 100644 --- a/common/djangoapps/student/helpers.py +++ b/common/djangoapps/student/helpers.py @@ -1,16 +1,12 @@ """Helpers for the student app. """ -import time from datetime import datetime import urllib from pytz import UTC - -from django.utils.http import cookie_date -from django.conf import settings from django.core.urlresolvers import reverse, NoReverseMatch import third_party_auth -from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=F0401 +from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=import-error from course_modes.models import CourseMode diff --git a/common/djangoapps/student/tests/test_email.py b/common/djangoapps/student/tests/test_email.py index f04fd5b51e..d7aaf01180 100644 --- a/common/djangoapps/student/tests/test_email.py +++ b/common/djangoapps/student/tests/test_email.py @@ -11,11 +11,11 @@ from student.views import ( from student.models import UserProfile, PendingEmailChange from django.core.urlresolvers import reverse from django.core import mail -from django.contrib.auth.models import User, AnonymousUser +from django.contrib.auth.models import User from django.test import TestCase, TransactionTestCase from django.test.client import RequestFactory from mock import Mock, patch -from django.http import Http404, HttpResponse +from django.http import HttpResponse from django.conf import settings from edxmako.shortcuts import render_to_string from edxmako.tests import mako_middleware_process_request diff --git a/common/djangoapps/student/tests/test_login_registration_forms.py b/common/djangoapps/student/tests/test_login_registration_forms.py index 3b0606d8b9..a17161ed0a 100644 --- a/common/djangoapps/student/tests/test_login_registration_forms.py +++ b/common/djangoapps/student/tests/test_login_registration_forms.py @@ -1,7 +1,6 @@ """Tests for the login and registration form rendering. """ import urllib import unittest -from collections import OrderedDict import ddt from mock import patch @@ -10,7 +9,6 @@ from django.core.urlresolvers import reverse from util.testing import UrlResetMixin from xmodule.modulestore.tests.factories import CourseFactory -from student.tests.factories import CourseModeFactory from third_party_auth.tests.testutil import ThirdPartyAuthTestMixin from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase diff --git a/common/djangoapps/student/tests/test_verification_status.py b/common/djangoapps/student/tests/test_verification_status.py index d738f0a55e..ff23e9401e 100644 --- a/common/djangoapps/student/tests/test_verification_status.py +++ b/common/djangoapps/student/tests/test_verification_status.py @@ -20,7 +20,7 @@ from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from student.tests.factories import UserFactory, CourseEnrollmentFactory from course_modes.tests.factories import CourseModeFactory -from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=F0401 +from verify_student.models import SoftwareSecurePhotoVerification # pylint: disable=import-error from util.testing import UrlResetMixin diff --git a/common/djangoapps/student/tests/tests.py b/common/djangoapps/student/tests/tests.py index e1575da5e9..5051421cd4 100644 --- a/common/djangoapps/student/tests/tests.py +++ b/common/djangoapps/student/tests/tests.py @@ -10,18 +10,20 @@ import ddt from django.conf import settings from django.contrib.auth.models import User, AnonymousUser -from django.contrib.sessions.middleware import SessionMiddleware from django.core.urlresolvers import reverse from django.test import TestCase -from django.test.client import RequestFactory, Client +from django.test.client import Client from mock import Mock, patch from opaque_keys.edx.locations import SlashSeparatedCourseKey from student.models import ( anonymous_id_for_user, user_by_anonymous_id, CourseEnrollment, unique_id_for_user, LinkedInAddToProfileConfiguration ) -from student.views import (process_survey_link, _cert_info, - change_enrollment, complete_course_mode_info) +from student.views import ( + process_survey_link, + _cert_info, + complete_course_mode_info, +) from student.tests.factories import UserFactory, CourseModeFactory from util.testing import EventTestMixin from util.model_utils import USER_SETTINGS_CHANGED_EVENT_NAME diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index e98ce9473b..ef895c56a2 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -6,7 +6,6 @@ import logging import uuid import json import warnings -from datetime import timedelta from collections import defaultdict from pytz import UTC from requests import HTTPError @@ -26,9 +25,8 @@ from django.db import IntegrityError, transaction from django.http import (HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseServerError, Http404) from django.shortcuts import redirect -from django.utils import timezone from django.utils.translation import ungettext -from django.utils.http import cookie_date, base36_to_int +from django.utils.http import base36_to_int from django.utils.translation import ugettext as _, get_language from django.views.decorators.cache import never_cache from django.views.decorators.csrf import csrf_exempt, ensure_csrf_cookie @@ -49,7 +47,7 @@ from edxmako.shortcuts import render_to_response, render_to_string from course_modes.models import CourseMode from shoppingcart.api import order_history from student.models import ( - Registration, UserProfile, PendingNameChange, + Registration, UserProfile, PendingEmailChange, CourseEnrollment, CourseEnrollmentAttribute, unique_id_for_user, CourseEnrollmentAllowed, UserStanding, LoginFailures, create_comments_service_user, PasswordHistory, UserSignupSource, @@ -60,10 +58,8 @@ from verify_student.models import SoftwareSecurePhotoVerification # pylint: dis from certificates.models import CertificateStatuses, certificate_status_for_student from certificates.api import ( # pylint: disable=import-error get_certificate_url, - get_active_web_certificate, has_html_certificates_enabled, ) -from dark_lang.models import DarkLangConfig from xmodule.modulestore.django import modulestore from opaque_keys import InvalidKeyError @@ -86,7 +82,6 @@ from external_auth.login_and_register import ( ) from bulk_email.models import Optout, CourseAuthorization -import shoppingcart from lang_pref import LANGUAGE_KEY import track.views diff --git a/common/djangoapps/third_party_auth/pipeline.py b/common/djangoapps/third_party_auth/pipeline.py index 5bc4f069dd..74dd7780a2 100644 --- a/common/djangoapps/third_party_auth/pipeline.py +++ b/common/djangoapps/third_party_auth/pipeline.py @@ -80,9 +80,6 @@ from logging import getLogger from . import provider -# Note that this lives in openedx, so this dependency should be refactored. -from openedx.core.djangoapps.user_api.preferences.api import update_email_opt_in - # These are the query string params you can pass # to the URL that starts the authentication process. diff --git a/common/djangoapps/third_party_auth/tests/specs/base.py b/common/djangoapps/third_party_auth/tests/specs/base.py index 4b431069fd..f1bed2ef5a 100644 --- a/common/djangoapps/third_party_auth/tests/specs/base.py +++ b/common/djangoapps/third_party_auth/tests/specs/base.py @@ -1,6 +1,5 @@ """Base integration test for provider implementations.""" -import re import unittest import json diff --git a/common/djangoapps/third_party_auth/tests/specs/test_google.py b/common/djangoapps/third_party_auth/tests/specs/test_google.py index d591c1e594..4a83bb7e74 100644 --- a/common/djangoapps/third_party_auth/tests/specs/test_google.py +++ b/common/djangoapps/third_party_auth/tests/specs/test_google.py @@ -1,6 +1,5 @@ """Integration tests for Google providers.""" -from third_party_auth import provider from third_party_auth.tests.specs import base diff --git a/common/djangoapps/third_party_auth/tests/specs/test_linkedin.py b/common/djangoapps/third_party_auth/tests/specs/test_linkedin.py index c149065115..a5f0e61cc7 100644 --- a/common/djangoapps/third_party_auth/tests/specs/test_linkedin.py +++ b/common/djangoapps/third_party_auth/tests/specs/test_linkedin.py @@ -1,6 +1,5 @@ """Integration tests for LinkedIn providers.""" -from third_party_auth import provider from third_party_auth.tests.specs import base diff --git a/common/djangoapps/third_party_auth/tests/test_pipeline.py b/common/djangoapps/third_party_auth/tests/test_pipeline.py index c4387626ea..7bbd5cf186 100644 --- a/common/djangoapps/third_party_auth/tests/test_pipeline.py +++ b/common/djangoapps/third_party_auth/tests/test_pipeline.py @@ -2,7 +2,7 @@ import random -from third_party_auth import pipeline, provider +from third_party_auth import pipeline from third_party_auth.tests import testutil import unittest diff --git a/common/djangoapps/track/models.py b/common/djangoapps/track/models.py index 228819b059..c59cf6502a 100644 --- a/common/djangoapps/track/models.py +++ b/common/djangoapps/track/models.py @@ -1 +1,2 @@ +# pylint: disable=unused-import, missing-docstring from track.backends.django import TrackingLog diff --git a/common/djangoapps/track/views/tests/test_views.py b/common/djangoapps/track/views/tests/test_views.py index 18c684fda5..7e23136b3b 100644 --- a/common/djangoapps/track/views/tests/test_views.py +++ b/common/djangoapps/track/views/tests/test_views.py @@ -3,18 +3,14 @@ from mock import patch, sentinel from django.contrib.auth.models import User -from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_settings -from eventtracking import tracker from track import views from track.middleware import TrackMiddleware from track.tests import EventTrackingTestCase, FROZEN_TIME from openedx.core.lib.tests.assertions.events import assert_event_matches -from datetime import datetime - class TestTrackViews(EventTrackingTestCase): diff --git a/common/lib/safe_lxml/safe_lxml/etree.py b/common/lib/safe_lxml/safe_lxml/etree.py index 97bc0b7547..c087e99052 100644 --- a/common/lib/safe_lxml/safe_lxml/etree.py +++ b/common/lib/safe_lxml/safe_lxml/etree.py @@ -12,7 +12,7 @@ from lxml.etree import XMLParser as _XMLParser from lxml.etree import _Element, _ElementTree # pylint: disable=unused-import, no-name-in-module # This should be imported after lxml.etree so that it overrides the following attributes. -from defusedxml.lxml import parse, fromstring, XML +from defusedxml.lxml import parse, fromstring, XML # pylint: disable=unused-import class XMLParser(_XMLParser): # pylint: disable=function-redefined diff --git a/common/lib/xmodule/xmodule/discussion_module.py b/common/lib/xmodule/xmodule/discussion_module.py index ed787fb296..0e418deed7 100644 --- a/common/lib/xmodule/xmodule/discussion_module.py +++ b/common/lib/xmodule/xmodule/discussion_module.py @@ -4,7 +4,6 @@ from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xmodule.editing_module import MetadataOnlyEditingDescriptor from xblock.fields import String, Scope, UNIQUE_ID -from uuid import uuid4 # Make '_' a no-op so we can scrape strings _ = lambda text: text diff --git a/common/lib/xmodule/xmodule/modulestore/tests/factories.py b/common/lib/xmodule/xmodule/modulestore/tests/factories.py index abfc1f9664..df5de468b0 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/factories.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/factories.py @@ -3,8 +3,6 @@ Factories for use in tests of XBlocks. """ import functools -import inspect -import pprint import pymongo.message import threading import traceback @@ -14,7 +12,7 @@ from uuid import uuid4 from factory import Factory, Sequence, lazy_attribute_sequence, lazy_attribute from factory.containers import CyclicDefinitionError -from mock import Mock, patch +from mock import patch from nose.tools import assert_less_equal, assert_greater_equal import dogstats_wrapper as dog_stats_api 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 4ed6aa7c00..c227fdc584 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py @@ -8,7 +8,6 @@ import logging import ddt import itertools import mimetypes -from unittest import skip from uuid import uuid4 from contextlib import contextmanager from mock import patch diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py b/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py index c39bbf4534..ad7c9ef989 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py @@ -3,7 +3,6 @@ Tests for XML importer. """ import mock from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator -from xblock.core import XBlock from xblock.fields import String, Scope, ScopeIds, List from xblock.runtime import Runtime, KvsFieldData, DictKeyValueStore from xmodule.x_module import XModuleMixin diff --git a/common/lib/xmodule/xmodule/video_module/video_xfields.py b/common/lib/xmodule/xmodule/video_module/video_xfields.py index 65421fa905..a10434d785 100644 --- a/common/lib/xmodule/xmodule/video_module/video_xfields.py +++ b/common/lib/xmodule/xmodule/video_module/video_xfields.py @@ -6,7 +6,6 @@ import datetime from xblock.fields import Scope, String, Float, Boolean, List, Dict, DateTime from xmodule.fields import RelativeTime -from xmodule.mixin import LicenseMixin # Make '_' a no-op so we can scrape strings _ = lambda text: text diff --git a/common/lib/xmodule/xmodule/wrapper_module.py b/common/lib/xmodule/xmodule/wrapper_module.py index 622fbd28e7..63e132716d 100644 --- a/common/lib/xmodule/xmodule/wrapper_module.py +++ b/common/lib/xmodule/xmodule/wrapper_module.py @@ -2,7 +2,6 @@ # But w/o css delimiters between children from xmodule.vertical_block import VerticalBlock -from pkg_resources import resource_string # HACK: This shouldn't be hard-coded to two types # OBSOLETE: This obsoletes 'type' diff --git a/common/test/acceptance/pages/lms/dashboard.py b/common/test/acceptance/pages/lms/dashboard.py index 8b83a6bf75..182da86be4 100644 --- a/common/test/acceptance/pages/lms/dashboard.py +++ b/common/test/acceptance/pages/lms/dashboard.py @@ -4,7 +4,6 @@ Student dashboard page. """ from bok_choy.page_object import PageObject -from bok_choy.promise import EmptyPromise from . import BASE_URL diff --git a/common/test/acceptance/pages/lms/find_courses.py b/common/test/acceptance/pages/lms/find_courses.py index 0a008588b1..564891b1f3 100644 --- a/common/test/acceptance/pages/lms/find_courses.py +++ b/common/test/acceptance/pages/lms/find_courses.py @@ -3,7 +3,6 @@ Find courses page (main page of the LMS). """ from bok_choy.page_object import PageObject -from bok_choy.promise import BrokenPromise from . import BASE_URL diff --git a/common/test/acceptance/pages/lms/pay_and_verify.py b/common/test/acceptance/pages/lms/pay_and_verify.py index 0b27a0d69d..3897610b88 100644 --- a/common/test/acceptance/pages/lms/pay_and_verify.py +++ b/common/test/acceptance/pages/lms/pay_and_verify.py @@ -1,10 +1,9 @@ """Payment and verification pages""" import re -from urllib import urlencode -from bok_choy.page_object import PageObject, unguarded -from bok_choy.promise import Promise, EmptyPromise +from bok_choy.page_object import PageObject +from bok_choy.promise import Promise from . import BASE_URL from .dashboard import DashboardPage diff --git a/common/test/acceptance/pages/lms/track_selection.py b/common/test/acceptance/pages/lms/track_selection.py index 86ce7488f1..3b701d69e8 100644 --- a/common/test/acceptance/pages/lms/track_selection.py +++ b/common/test/acceptance/pages/lms/track_selection.py @@ -1,9 +1,5 @@ """Track selection page""" - -from urllib import urlencode - -from bok_choy.page_object import PageObject, unguarded -from bok_choy.promise import Promise, EmptyPromise +from bok_choy.page_object import PageObject from . import BASE_URL from .dashboard import DashboardPage from .pay_and_verify import PaymentAndVerificationFlow diff --git a/common/test/acceptance/pages/studio/overview.py b/common/test/acceptance/pages/studio/overview.py index 842bd0d0dc..b3d22bf26e 100644 --- a/common/test/acceptance/pages/studio/overview.py +++ b/common/test/acceptance/pages/studio/overview.py @@ -8,7 +8,6 @@ from bok_choy.promise import EmptyPromise from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys -from selenium.webdriver.common.action_chains import ActionChains from .course_page import CoursePage from .container import ContainerPage diff --git a/common/test/acceptance/performance/test_lms_performance.py b/common/test/acceptance/performance/test_lms_performance.py index 1673eff593..dcde42220c 100644 --- a/common/test/acceptance/performance/test_lms_performance.py +++ b/common/test/acceptance/performance/test_lms_performance.py @@ -1,7 +1,7 @@ """ Single page performance tests for LMS. """ -from bok_choy.web_app_test import WebAppTest, with_cache +from bok_choy.web_app_test import with_cache from ..pages.lms.auto_auth import AutoAuthPage from ..pages.lms.courseware import CoursewarePage from ..pages.lms.dashboard import DashboardPage diff --git a/common/test/acceptance/tests/lms/test_lms.py b/common/test/acceptance/tests/lms/test_lms.py index 00eb2b33cc..aca838c47b 100644 --- a/common/test/acceptance/tests/lms/test_lms.py +++ b/common/test/acceptance/tests/lms/test_lms.py @@ -9,7 +9,6 @@ from unittest import skip from nose.plugins.attrib import attr from bok_choy.promise import EmptyPromise -from bok_choy.web_app_test import WebAppTest from ..helpers import ( UniqueCourseTest, EventsTestMixin, diff --git a/common/test/acceptance/tests/lms/test_lms_course_discovery.py b/common/test/acceptance/tests/lms/test_lms_course_discovery.py index 084a15b4e5..8bfe044770 100644 --- a/common/test/acceptance/tests/lms/test_lms_course_discovery.py +++ b/common/test/acceptance/tests/lms/test_lms_course_discovery.py @@ -2,9 +2,7 @@ Test course discovery. """ import datetime -from flaky import flaky import json -import os from bok_choy.web_app_test import WebAppTest from ..helpers import remove_file diff --git a/common/test/acceptance/tests/lms/test_lms_courseware_search.py b/common/test/acceptance/tests/lms/test_lms_courseware_search.py index 30f4153d76..8b94b185f7 100644 --- a/common/test/acceptance/tests/lms/test_lms_courseware_search.py +++ b/common/test/acceptance/tests/lms/test_lms_courseware_search.py @@ -1,7 +1,6 @@ """ Test courseware search """ -import os import json from nose.plugins.attrib import attr diff --git a/common/test/acceptance/tests/lms/test_lms_edxnotes.py b/common/test/acceptance/tests/lms/test_lms_edxnotes.py index 3bc66aa3da..b51ebdfab0 100644 --- a/common/test/acceptance/tests/lms/test_lms_edxnotes.py +++ b/common/test/acceptance/tests/lms/test_lms_edxnotes.py @@ -1,4 +1,6 @@ -import os +""" +Test LMS Notes +""" from uuid import uuid4 from datetime import datetime from nose.plugins.attrib import attr diff --git a/common/test/acceptance/tests/lms/test_lms_user_preview.py b/common/test/acceptance/tests/lms/test_lms_user_preview.py index ff23534ee3..292bbf8dcf 100644 --- a/common/test/acceptance/tests/lms/test_lms_user_preview.py +++ b/common/test/acceptance/tests/lms/test_lms_user_preview.py @@ -7,7 +7,6 @@ from ..helpers import UniqueCourseTest, create_user_partition_json from ...pages.studio.auto_auth import AutoAuthPage from ...pages.lms.courseware import CoursewarePage from ...pages.lms.staff_view import StaffPage -from ...pages.lms.course_nav import CourseNavPage from ...fixtures.course import CourseFixture, XBlockFixtureDesc from xmodule.partitions.partitions import Group from textwrap import dedent diff --git a/common/test/acceptance/tests/studio/test_studio_home.py b/common/test/acceptance/tests/studio/test_studio_home.py index 747bc7aeb8..ff4211783e 100644 --- a/common/test/acceptance/tests/studio/test_studio_home.py +++ b/common/test/acceptance/tests/studio/test_studio_home.py @@ -3,7 +3,6 @@ Acceptance tests for Home Page (My Courses / My Libraries). """ from bok_choy.web_app_test import WebAppTest from opaque_keys.edx.locator import LibraryLocator -from unittest import skip from ...pages.studio.auto_auth import AutoAuthPage from ...pages.studio.library import LibraryEditPage diff --git a/common/test/acceptance/tests/studio/test_studio_library.py b/common/test/acceptance/tests/studio/test_studio_library.py index 28fd99800a..0086024f69 100644 --- a/common/test/acceptance/tests/studio/test_studio_library.py +++ b/common/test/acceptance/tests/studio/test_studio_library.py @@ -2,7 +2,6 @@ Acceptance tests for Content Libraries in Studio """ from ddt import ddt, data -from unittest import skip from nose.plugins.attrib import attr from flaky import flaky diff --git a/common/test/acceptance/tests/studio/test_studio_settings.py b/common/test/acceptance/tests/studio/test_studio_settings.py index a51c3148c3..39eed95996 100644 --- a/common/test/acceptance/tests/studio/test_studio_settings.py +++ b/common/test/acceptance/tests/studio/test_studio_settings.py @@ -14,7 +14,6 @@ from ...pages.studio.settings import SettingsPage from ...pages.studio.settings_advanced import AdvancedSettingsPage from ...pages.studio.settings_group_configurations import GroupConfigurationsPage from ...pages.lms.courseware import CoursewarePage -from unittest import skip from textwrap import dedent from xmodule.partitions.partitions import Group diff --git a/common/test/acceptance/tests/studio/test_studio_split_test.py b/common/test/acceptance/tests/studio/test_studio_split_test.py index cedb89ed44..7c125bb104 100644 --- a/common/test/acceptance/tests/studio/test_studio_split_test.py +++ b/common/test/acceptance/tests/studio/test_studio_split_test.py @@ -2,7 +2,6 @@ Acceptance tests for Studio related to the split_test module. """ -import json import math from unittest import skip from nose.plugins.attrib import attr diff --git a/common/test/acceptance/tests/test_annotatable.py b/common/test/acceptance/tests/test_annotatable.py index fc9beed182..0e470da265 100644 --- a/common/test/acceptance/tests/test_annotatable.py +++ b/common/test/acceptance/tests/test_annotatable.py @@ -2,8 +2,6 @@ """ E2E tests for the LMS. """ -import time - from unittest import skip from .helpers import UniqueCourseTest @@ -11,7 +9,6 @@ from ..pages.studio.auto_auth import AutoAuthPage from ..pages.lms.courseware import CoursewarePage from ..pages.lms.annotation_component import AnnotationComponentPage from ..fixtures.course import CourseFixture, XBlockFixtureDesc -from ..fixtures.xqueue import XQueueResponseFixture from textwrap import dedent diff --git a/lms/djangoapps/ccx/views.py b/lms/djangoapps/ccx/views.py index 0c7db60b7d..554f0be9b3 100644 --- a/lms/djangoapps/ccx/views.py +++ b/lms/djangoapps/ccx/views.py @@ -16,7 +16,6 @@ from django.core.urlresolvers import reverse from django.http import ( HttpResponse, HttpResponseForbidden, - HttpResponseRedirect, ) from django.contrib import messages from django.core.exceptions import ValidationError @@ -26,23 +25,22 @@ from django.shortcuts import redirect from django.utils.translation import ugettext as _ from django.views.decorators.cache import cache_control from django.views.decorators.csrf import ensure_csrf_cookie -from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User -from courseware.courses import get_course_by_id # pylint: disable=import-error +from courseware.courses import get_course_by_id -from courseware.field_overrides import disable_overrides # pylint: disable=import-error -from courseware.grades import iterate_grades_for # pylint: disable=import-error -from courseware.model_data import FieldDataCache # pylint: disable=import-error -from courseware.module_render import get_module_for_descriptor # pylint: disable=import-error -from edxmako.shortcuts import render_to_response # pylint: disable=import-error +from courseware.field_overrides import disable_overrides +from courseware.grades import iterate_grades_for +from courseware.model_data import FieldDataCache +from courseware.module_render import get_module_for_descriptor +from edxmako.shortcuts import render_to_response from opaque_keys.edx.keys import CourseKey from ccx_keys.locator import CCXLocator -from student.roles import CourseCcxCoachRole # pylint: disable=import-error +from student.roles import CourseCcxCoachRole -from instructor.offline_gradecalc import student_grades # pylint: disable=import-error -from instructor.views.api import _split_input_list # pylint: disable=import-error -from instructor.views.tools import get_student_from_identifier # pylint: disable=import-error +from instructor.offline_gradecalc import student_grades +from instructor.views.api import _split_input_list +from instructor.views.tools import get_student_from_identifier from .models import CustomCourseForEdX, CcxMembership from .overrides import ( diff --git a/lms/djangoapps/commerce/urls.py b/lms/djangoapps/commerce/urls.py index 4b068ef0c7..fb33f18d75 100644 --- a/lms/djangoapps/commerce/urls.py +++ b/lms/djangoapps/commerce/urls.py @@ -1,7 +1,7 @@ """ Defines the URL routes for this app. """ -from django.conf.urls import patterns, url, include +from django.conf.urls import patterns, url from commerce import views diff --git a/lms/djangoapps/courseware/features/gst.py b/lms/djangoapps/courseware/features/gst.py index 3ce668e3f1..f232f9dfad 100644 --- a/lms/djangoapps/courseware/features/gst.py +++ b/lms/djangoapps/courseware/features/gst.py @@ -1,9 +1,8 @@ from lettuce import world, steps -from nose.tools import assert_in, assert_equals, assert_true +from nose.tools import assert_equals from common import i_am_registered_for_the_course, visit_scenario_item -from problems_setup import add_problem_to_course, answer_problem DEFAULT_DATA = """\ diff --git a/lms/djangoapps/courseware/features/video.py b/lms/djangoapps/courseware/features/video.py index 672c6648cb..767af3083a 100644 --- a/lms/djangoapps/courseware/features/video.py +++ b/lms/djangoapps/courseware/features/video.py @@ -6,7 +6,7 @@ import json import os import time import requests -from nose.tools import assert_less, assert_equal, assert_true, assert_false +from nose.tools import assert_equal, assert_true, assert_false from common import i_am_registered_for_the_course, visit_scenario_item from django.utils.translation import ugettext as _ from django.conf import settings diff --git a/lms/djangoapps/courseware/features/word_cloud.py b/lms/djangoapps/courseware/features/word_cloud.py index fa0ea081a8..a385d780cb 100644 --- a/lms/djangoapps/courseware/features/word_cloud.py +++ b/lms/djangoapps/courseware/features/word_cloud.py @@ -1,9 +1,6 @@ # pylint: disable=missing-docstring -from time import sleep - from lettuce import world, step -from lettuce.django import django_url from common import i_am_registered_for_the_course, section_location, visit_scenario_item diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 6b27df0958..0ad3b06f5f 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -7,7 +7,6 @@ import urllib import json import cgi -from collections import OrderedDict from datetime import datetime from django.utils import translation from django.utils.translation import ugettext as _ diff --git a/lms/djangoapps/discussion_api/forms.py b/lms/djangoapps/discussion_api/forms.py index eaa9d69598..e53639ff69 100644 --- a/lms/djangoapps/discussion_api/forms.py +++ b/lms/djangoapps/discussion_api/forms.py @@ -5,7 +5,6 @@ from django.core.exceptions import ValidationError from django.forms import ( BooleanField, CharField, - ChoiceField, Field, Form, IntegerField, diff --git a/lms/djangoapps/django_comment_client/forum/tests.py b/lms/djangoapps/django_comment_client/forum/tests.py index e9d0ff75b4..b75e5cdc8c 100644 --- a/lms/djangoapps/django_comment_client/forum/tests.py +++ b/lms/djangoapps/django_comment_client/forum/tests.py @@ -2,7 +2,6 @@ import json import logging import ddt -from django.core import cache from django.core.urlresolvers import reverse from django.http import Http404 from django.test.client import Client, RequestFactory diff --git a/lms/djangoapps/django_comment_client/permissions.py b/lms/djangoapps/django_comment_client/permissions.py index 39101f73f1..5b9544d41e 100644 --- a/lms/djangoapps/django_comment_client/permissions.py +++ b/lms/djangoapps/django_comment_client/permissions.py @@ -4,7 +4,6 @@ Module for checking permissions with the comment_client backend import logging from types import NoneType -from django.core import cache from request_cache.middleware import RequestCache from lms.lib.comment_client import Thread diff --git a/lms/djangoapps/instructor_task/tests/test_integration.py b/lms/djangoapps/instructor_task/tests/test_integration.py index db3e4d5c9c..dcc316bc2f 100644 --- a/lms/djangoapps/instructor_task/tests/test_integration.py +++ b/lms/djangoapps/instructor_task/tests/test_integration.py @@ -19,7 +19,6 @@ from capa.tests.response_xml_factory import (CodeResponseXMLFactory, CustomResponseXMLFactory) from xmodule.modulestore.tests.factories import ItemFactory from xmodule.modulestore import ModuleStoreEnum -from xmodule.partitions.partitions import Group, UserPartition from courseware.model_data import StudentModule @@ -29,8 +28,12 @@ from instructor_task.api import (submit_rescore_problem_for_all_students, submit_delete_problem_state_for_all_students) from instructor_task.models import InstructorTask from instructor_task.tasks_helper import upload_grades_csv -from instructor_task.tests.test_base import (InstructorTaskModuleTestCase, TestReportMixin, TEST_COURSE_ORG, - TEST_COURSE_NUMBER, OPTION_1, OPTION_2) +from instructor_task.tests.test_base import ( + InstructorTaskModuleTestCase, + TestReportMixin, + OPTION_1, + OPTION_2, +) from capa.responsetypes import StudentInputError from lms.djangoapps.lms_xblock.runtime import quote_slashes diff --git a/lms/djangoapps/lti_provider/views.py b/lms/djangoapps/lti_provider/views.py index 2a461ce550..6325771e23 100644 --- a/lms/djangoapps/lti_provider/views.py +++ b/lms/djangoapps/lti_provider/views.py @@ -3,9 +3,6 @@ LTI Provider view functions """ from django.conf import settings -from django.contrib.auth.decorators import login_required -from django.contrib.auth.views import redirect_to_login -from django.core.urlresolvers import reverse from django.http import HttpResponseBadRequest, HttpResponseForbidden, Http404 from django.views.decorators.csrf import csrf_exempt import logging diff --git a/lms/djangoapps/mobile_api/course_info/views.py b/lms/djangoapps/mobile_api/course_info/views.py index 8c8fd3e694..ef96ae6e40 100644 --- a/lms/djangoapps/mobile_api/course_info/views.py +++ b/lms/djangoapps/mobile_api/course_info/views.py @@ -5,7 +5,7 @@ from django.http import Http404 from rest_framework import generics from rest_framework.response import Response -from courseware.courses import get_course_about_section, get_course_info_section_module +from courseware.courses import get_course_info_section_module from static_replace import make_static_urls_absolute, replace_static_urls from openedx.core.lib.xblock_utils import get_course_update_items diff --git a/lms/djangoapps/mobile_api/users/serializers.py b/lms/djangoapps/mobile_api/users/serializers.py index b4876b3ae4..1ebbb572de 100644 --- a/lms/djangoapps/mobile_api/users/serializers.py +++ b/lms/djangoapps/mobile_api/users/serializers.py @@ -4,7 +4,6 @@ Serializer for user API from rest_framework import serializers from rest_framework.reverse import reverse -from courseware.courses import course_image_url from student.models import CourseEnrollment, User from certificates.models import certificate_status_for_student, CertificateStatuses diff --git a/lms/djangoapps/shoppingcart/tests/test_views.py b/lms/djangoapps/shoppingcart/tests/test_views.py index ab10d0bd7b..96eaa975b2 100644 --- a/lms/djangoapps/shoppingcart/tests/test_views.py +++ b/lms/djangoapps/shoppingcart/tests/test_views.py @@ -12,7 +12,6 @@ from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from django.core.urlresolvers import reverse -from django.utils.translation import ugettext as _ from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import Group, User from django.contrib.messages.storage.fallback import FallbackStorage diff --git a/lms/djangoapps/shoppingcart/views.py b/lms/djangoapps/shoppingcart/views.py index 30e67d872f..937969c925 100644 --- a/lms/djangoapps/shoppingcart/views.py +++ b/lms/djangoapps/shoppingcart/views.py @@ -50,7 +50,6 @@ from .processors import ( ) import json -from xmodule_django.models import CourseKeyField from .decorators import enforce_shopping_cart_enabled diff --git a/lms/djangoapps/student_account/test/test_views.py b/lms/djangoapps/student_account/test/test_views.py index 786c3427b7..7997da12a7 100644 --- a/lms/djangoapps/student_account/test/test_views.py +++ b/lms/djangoapps/student_account/test/test_views.py @@ -18,15 +18,13 @@ from django.test import TestCase from django.test.utils import override_settings from django.test.client import RequestFactory -from embargo.test_utils import restrict_course from openedx.core.djangoapps.user_api.accounts.api import activate_account, create_account from openedx.core.djangoapps.user_api.accounts import EMAIL_MAX_LENGTH -from student.tests.factories import CourseModeFactory, UserFactory +from student.tests.factories import UserFactory from student_account.views import account_settings_context from third_party_auth.tests.testutil import simulate_running_pipeline, ThirdPartyAuthTestMixin from util.testing import UrlResetMixin from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory @ddt.ddt diff --git a/lms/djangoapps/student_profile/views.py b/lms/djangoapps/student_profile/views.py index 78354af3a4..76620b419b 100644 --- a/lms/djangoapps/student_profile/views.py +++ b/lms/djangoapps/student_profile/views.py @@ -17,8 +17,6 @@ from openedx.core.djangoapps.user_api.preferences.api import get_user_preference from student.models import User from microsite_configuration import microsite -from django.utils.translation import ugettext as _ - @login_required @require_http_methods(['GET']) diff --git a/lms/djangoapps/verify_student/models.py b/lms/djangoapps/verify_student/models.py index ec7b50dd4b..2196a5c773 100644 --- a/lms/djangoapps/verify_student/models.py +++ b/lms/djangoapps/verify_student/models.py @@ -25,7 +25,7 @@ from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.db import models -from django.utils.translation import ugettext as _, ugettext_lazy +from django.utils.translation import ugettext as _ from boto.s3.connection import S3Connection from boto.s3.key import Key diff --git a/lms/djangoapps/verify_student/tests/test_models.py b/lms/djangoapps/verify_student/tests/test_models.py index b63f96becd..a365f1f5b4 100644 --- a/lms/djangoapps/verify_student/tests/test_models.py +++ b/lms/djangoapps/verify_student/tests/test_models.py @@ -8,8 +8,7 @@ import pytz from django.conf import settings from django.db.utils import IntegrityError from mock import patch -from nose.tools import assert_is_none, assert_equals, assert_raises, assert_true, assert_false # pylint: disable=E0611 -from opaque_keys.edx.locations import SlashSeparatedCourseKey +from nose.tools import assert_is_none, assert_equals, assert_raises, assert_true, assert_false # pylint: disable=no-name-in-module from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase diff --git a/lms/djangoapps/verify_student/tests/test_views.py b/lms/djangoapps/verify_student/tests/test_views.py index d188a85e58..0d900044a9 100644 --- a/lms/djangoapps/verify_student/tests/test_views.py +++ b/lms/djangoapps/verify_student/tests/test_views.py @@ -17,7 +17,6 @@ from mock import patch, Mock, ANY from django.conf import settings from django.core.urlresolvers import reverse -from django.core.exceptions import ObjectDoesNotExist from django.core import mail from django.test import TestCase from django.test.client import Client, RequestFactory @@ -33,7 +32,6 @@ from course_modes.tests.factories import CourseModeFactory from courseware.url_helpers import get_redirect_url from commerce.tests import TEST_PAYMENT_DATA, TEST_API_URL, TEST_API_SIGNING_KEY from embargo.test_utils import restrict_course -from microsite_configuration import microsite from openedx.core.djangoapps.user_api.accounts.api import get_account_settings from shoppingcart.models import Order, CertificateItem from student.tests.factories import UserFactory, CourseEnrollmentFactory @@ -42,7 +40,7 @@ from util.date_utils import get_default_time_display from util.testing import UrlResetMixin from verify_student.views import ( checkout_with_ecommerce_service, render_to_response, PayAndVerifyView, - _send_email, _compose_message_reverification_email + _compose_message_reverification_email ) from verify_student.models import ( SoftwareSecurePhotoVerification, VerificationCheckpoint, diff --git a/lms/lib/courseware_search/lms_result_processor.py b/lms/lib/courseware_search/lms_result_processor.py index accb8d44a4..5102038178 100644 --- a/lms/lib/courseware_search/lms_result_processor.py +++ b/lms/lib/courseware_search/lms_result_processor.py @@ -4,12 +4,10 @@ This file contains implementation override of SearchResultProcessor which will a * Confirms user access to object """ from django.core.urlresolvers import reverse -from django.utils.translation import ugettext as _ from opaque_keys.edx.locations import SlashSeparatedCourseKey from search.result_processor import SearchResultProcessor from xmodule.modulestore.django import modulestore -from xmodule.modulestore.search import path_to_location, navigation_index from courseware.access import has_access diff --git a/lms/tests.py b/lms/tests.py index 09946a9fbb..cf9a082b8b 100644 --- a/lms/tests.py +++ b/lms/tests.py @@ -10,7 +10,6 @@ from edxmako import add_lookup, LOOKUP from lms import startup from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from util import keyword_substitution class LmsModuleTests(TestCase): diff --git a/lms/urls.py b/lms/urls.py index 70d1bf4619..adc0a090c6 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -605,7 +605,6 @@ if settings.FEATURES.get('RUN_AS_ANALYTICS_SERVER_ENABLED'): urlpatterns += ( url(r'^edinsights_service/', include('edinsights.core.urls')), ) - import edinsights.core.registry # FoldIt views urlpatterns += ( 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 57bb63b26e..3faaa0de2f 100644 --- a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py +++ b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py @@ -6,7 +6,6 @@ Test the partitions and partitions service import json from django.conf import settings import django.test -from django.test.utils import override_settings from mock import patch from unittest import skipUnless @@ -14,8 +13,8 @@ from courseware.masquerade import handle_ajax, setup_masquerade from courseware.tests.test_masquerade import StaffMasqueradeTestCase from student.tests.factories import UserFactory from xmodule.partitions.partitions import Group, UserPartition, UserPartitionError -from xmodule.modulestore.django import modulestore, clear_existing_modulestores -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, mixed_store_config, TEST_DATA_MIXED_TOY_MODULESTORE +from xmodule.modulestore.django import modulestore +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_TOY_MODULESTORE from opaque_keys.edx.locations import SlashSeparatedCourseKey from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme diff --git a/openedx/core/djangoapps/course_groups/views.py b/openedx/core/djangoapps/course_groups/views.py index e6cc061e3d..373991b57e 100644 --- a/openedx/core/djangoapps/course_groups/views.py +++ b/openedx/core/djangoapps/course_groups/views.py @@ -7,7 +7,7 @@ from django.views.decorators.http import require_POST from django.contrib.auth.models import User from django.core.paginator import Paginator, EmptyPage from django.core.urlresolvers import reverse -from django.http import Http404, HttpResponse, HttpResponseBadRequest +from django.http import Http404, HttpResponseBadRequest from django.views.decorators.http import require_http_methods from util.json_request import expect_json, JsonResponse from django.contrib.auth.decorators import login_required diff --git a/openedx/core/djangoapps/user_api/forms.py b/openedx/core/djangoapps/user_api/forms.py index 8dd6130623..0dd0456e83 100644 --- a/openedx/core/djangoapps/user_api/forms.py +++ b/openedx/core/djangoapps/user_api/forms.py @@ -1,2 +1,3 @@ +# pylint: disable=unused-import, missing-docstring # TODO: eventually move this implementation into the user_api from student.forms import PasswordResetFormNoActive diff --git a/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py b/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py index f3c320c0db..9ea502a166 100644 --- a/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py +++ b/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py @@ -7,14 +7,11 @@ import csv from collections import defaultdict from unittest import skipUnless - import ddt from django.conf import settings -from django.test.utils import override_settings from django.core.management.base import CommandError - -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, mixed_store_config +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from student.tests.factories import UserFactory, CourseEnrollmentFactory from student.models import CourseEnrollment diff --git a/openedx/core/djangoapps/user_api/models.py b/openedx/core/djangoapps/user_api/models.py index 0409f8d9c2..5a185de369 100644 --- a/openedx/core/djangoapps/user_api/models.py +++ b/openedx/core/djangoapps/user_api/models.py @@ -1,7 +1,7 @@ from django.contrib.auth.models import User from django.core.validators import RegexValidator from django.db import models -from django.db.models.signals import pre_delete, post_delete, pre_save, post_save +from django.db.models.signals import post_delete, pre_save, post_save from django.dispatch import receiver from model_utils.models import TimeStampedModel diff --git a/openedx/core/djangoapps/user_api/tests/test_models.py b/openedx/core/djangoapps/user_api/tests/test_models.py index 77292f63af..7b4cec224a 100644 --- a/openedx/core/djangoapps/user_api/tests/test_models.py +++ b/openedx/core/djangoapps/user_api/tests/test_models.py @@ -1,5 +1,6 @@ -import json - +""" +Test UserPreferenceModel and UserPreference events +""" from django.db import IntegrityError from django.test import TestCase diff --git a/pavelib/paver_tests/test_paver_get_quality_reports.py b/pavelib/paver_tests/test_paver_get_quality_reports.py index a1cde45300..1b9f7e83a1 100644 --- a/pavelib/paver_tests/test_paver_get_quality_reports.py +++ b/pavelib/paver_tests/test_paver_get_quality_reports.py @@ -1,12 +1,9 @@ -import os -import tempfile +""" +Tests to ensure only the report files we want are returned as part of run_quality. +""" import unittest -from mock import patch, Mock -from ddt import ddt, file_data - +from mock import patch import pavelib.quality -import paver.easy -from paver.easy import BuildFailure class TestGetReportFiles(unittest.TestCase): diff --git a/pavelib/tests.py b/pavelib/tests.py index 36a188476b..1d4cc1b224 100644 --- a/pavelib/tests.py +++ b/pavelib/tests.py @@ -3,7 +3,7 @@ Unit test tasks """ import os import sys -from paver.easy import sh, task, cmdopts, needs, call_task, no_help +from paver.easy import sh, task, cmdopts, needs, call_task from pavelib.utils.test import suites from pavelib.utils.envs import Env from optparse import make_option diff --git a/pavelib/utils/test/suites/nose_suite.py b/pavelib/utils/test/suites/nose_suite.py index 901a8efa57..5dab89cdbc 100644 --- a/pavelib/utils/test/suites/nose_suite.py +++ b/pavelib/utils/test/suites/nose_suite.py @@ -2,7 +2,6 @@ Classes used for defining and running nose test suites """ import os -from paver.easy import call_task from pavelib.utils.test import utils as test_utils from pavelib.utils.test.suites.suite import TestSuite from pavelib.utils.envs import Env