Commit 8b1978ba by Ned Batchelder

Fix unused-import errors

parent ef4c6988
......@@ -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
......
......@@ -2,7 +2,6 @@
import copy
import mock
from mock import patch
import shutil
import lxml.html
from lxml import etree
......
......@@ -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
......
......@@ -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
......
......@@ -3,7 +3,6 @@ Common utility functions useful throughout the contentstore
"""
import logging
import re
from datetime import datetime
from pytz import UTC
......
......@@ -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):
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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,
......
......@@ -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
......
......@@ -2,7 +2,6 @@
import datetime
import ddt
from django.test import TestCase
from student.models import UserProfile
from student.tests.factories import UserFactory
......
"""
API methods related to xblock state.
"""
from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConfigurationFlag
from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration
def deprecated_xblocks():
......
"""
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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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')
......
......@@ -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
......
......@@ -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,
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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,
......
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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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,
......
......@@ -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,
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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()
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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 (
......
......@@ -5,7 +5,6 @@ from __future__ import absolute_import
import logging
import mimetypes
import pkg_resources
from xblock.core import XBlock
......
......@@ -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
......
......@@ -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
......
......@@ -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 (
......
......@@ -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
......
......@@ -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'):
......
......@@ -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
......
"""
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
......
"""Tests covering edX API utilities."""
import json
import unittest
from django.core.cache import cache
from django.test.utils import override_settings
......
......@@ -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__)
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment