Merge pull request #12088 from edx/ned/remove-unused-imports

Remove unused imports
This commit is contained in:
Ned Batchelder
2016-04-08 14:20:31 -04:00
68 changed files with 34 additions and 99 deletions

View File

@@ -14,7 +14,7 @@ file and check it in at the same time as your model changes. To do that,
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models, transaction
from django.db import models
from openedx.core.lib.html_to_text import html_to_text
from openedx.core.lib.mail_utils import wrap_message

View File

@@ -5,7 +5,7 @@ by the individual custom courses feature.
import json
import logging
from django.db import transaction, IntegrityError
from django.db import transaction
import request_cache

View File

@@ -12,17 +12,12 @@ from student.roles import (
CourseInstructorRole,
CourseStaffRole,
)
from student.tests.factories import (
AdminFactory,
CourseEnrollmentFactory,
UserFactory
)
from student.tests.factories import AdminFactory
from student.models import CourseEnrollment, CourseEnrollmentException
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase,
SharedModuleStoreTestCase,
TEST_DATA_SPLIT_MODULESTORE
)
from xmodule.modulestore.tests.factories import CourseFactory

View File

@@ -41,7 +41,6 @@ from instructor.views.api import _split_input_list
from instructor.views.gradebook_api import get_grade_book_page
from instructor.enrollment import (
enroll_email,
unenroll_email,
get_email_params,
)

View File

@@ -55,7 +55,6 @@ from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models, transaction
from django.db.models import Count
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.fields import CreationDateTimeField

View File

@@ -12,7 +12,6 @@ from certificates.models import (
ExampleCertificateSet,
CertificateHtmlViewConfiguration,
CertificateTemplateAsset,
EligibleCertificateManager,
GeneratedCertificate,
CertificateStatuses,
)

View File

@@ -1,6 +1,5 @@
""" Tests for commerce views. """
import json
from uuid import uuid4
from nose.plugins.attrib import attr
import ddt

View File

@@ -7,7 +7,7 @@ import openedx.core.djangoapps.user_api.course_tag.api as course_tag_api
from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme
from student.tests.factories import CourseEnrollmentFactory
from xmodule.partitions.partitions import Group, UserPartition
from xmodule.modulestore.tests.factories import check_mongo_calls, check_mongo_calls_range
from xmodule.modulestore.tests.factories import check_mongo_calls
from ...api import get_course_blocks
from ..user_partitions import UserPartitionTransformer, _get_user_partition_groups

View File

@@ -14,7 +14,7 @@ from opaque_keys.edx.locator import CourseLocator
from xmodule.error_module import ErrorDescriptor
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, check_mongo_calls
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.xml import CourseLocationManager
from xmodule.tests import get_test_system

View File

@@ -6,7 +6,7 @@ from django.conf import settings
from django.http import Http404
from rest_framework.authentication import SessionAuthentication
from rest_framework_oauth.authentication import OAuth2Authentication
from rest_framework.exceptions import AuthenticationFailed, ParseError
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.generics import RetrieveAPIView, ListAPIView
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response

View File

@@ -28,7 +28,7 @@ from xmodule.course_module import (
CATALOG_VISIBILITY_ABOUT,
)
from xmodule.error_module import ErrorDescriptor
from xmodule.x_module import XModule, DEPRECATION_VSCOMPAT_EVENT
from xmodule.x_module import XModule
from xmodule.split_test_module import get_split_user_partitions
from xmodule.partitions.partitions import NoSuchUserPartitionError, NoSuchUserPartitionGroupError
@@ -54,8 +54,6 @@ from util.milestones_helpers import (
)
from ccx_keys.locator import CCXLocator
import dogstats_wrapper as dog_stats_api
from courseware.access_response import (
MilestoneError,
MobileAvailabilityError,

View File

@@ -1,7 +1,6 @@
"""
This file contains all entrance exam related utils/logic.
"""
from django.conf import settings
from courseware.access import has_access
from courseware.model_data import FieldDataCache, ScoresClient

View File

@@ -5,7 +5,6 @@
from lettuce import world, step
from common import course_location
from problems_setup import PROBLEM_DICT
from nose.tools import assert_in
@step(u'I am viewing a course with multiple sections')

View File

@@ -3,9 +3,8 @@
from optparse import make_option
from textwrap import dedent
from django.core.management.base import BaseCommand, CommandError
from django.core.management.base import BaseCommand
from xmodule.modulestore.django import modulestore
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview

View File

@@ -16,7 +16,7 @@ from django.core.management import call_command
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, mixed_store_config
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MONGO_MODULESTORE, TEST_DATA_SPLIT_MODULESTORE
)

View File

@@ -3,7 +3,6 @@
import datetime
import pytz
from dateutil.tz import tzutc
from django.test.utils import override_settings
from mock import patch

View File

@@ -2,7 +2,6 @@
Test cases for tabs.
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import Http404
from mock import MagicMock, Mock, patch

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Video xmodule tests in mongo."""
import ddt
import itertools
import json
from collections import OrderedDict
from path import Path as path

View File

@@ -2,7 +2,7 @@
"""
Tests courseware views.py
"""
import cgi
from urllib import urlencode
import ddt
import json

View File

@@ -14,7 +14,7 @@ except ImportError:
import dogstats_wrapper as dog_stats_api
from django.contrib.auth.models import User
from xblock.fields import Scope, ScopeBase
from xblock.fields import Scope
from courseware.models import StudentModule, BaseStudentModuleHistory
from edx_user_state_client.interface import XBlockUserStateClient, XBlockUserState

View File

@@ -10,21 +10,16 @@ from util.date_utils import get_time_display, DEFAULT_DATE_TIME_FORMAT
from nose.plugins.attrib import attr
from django.conf import settings
from django.contrib.auth.hashers import check_password
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.client import Client
from django.test.utils import override_settings
from django.utils.timezone import utc as UTC
from django.utils.translation import ugettext as _
import mongoengine
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from dashboard.models import CourseImportLog
from dashboard.sysadmin import Users
from dashboard.git_import import GitImportError
from datetime import datetime
from external_auth.models import ExternalAuthMap
from student.roles import CourseStaffRole, GlobalStaff
from student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore

View File

@@ -8,8 +8,7 @@ from django.forms import (
ChoiceField,
Form,
IntegerField,
NullBooleanField,
Select)
)
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locator import CourseLocator

View File

@@ -1,5 +1,4 @@
from django.core.management.base import BaseCommand, CommandError
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from courseware.courses import get_course

View File

@@ -4,7 +4,7 @@ Views related to EdxNotes.
import json
import logging
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseBadRequest, Http404
from django.http import HttpResponse, Http404
from django.conf import settings
from django.core.urlresolvers import reverse
from django.views.decorators.http import require_GET

View File

@@ -15,7 +15,6 @@ from django.utils.translation import override as override_language
from nose.plugins.attrib import attr
from ccx_keys.locator import CCXLocator
from student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from lms.djangoapps.ccx.tests.factories import CcxFactory

View File

@@ -18,7 +18,7 @@ from celery import Task, current_task
from celery.states import SUCCESS, FAILURE
from django.contrib.auth.models import User
from django.core.files.storage import DefaultStorage
from django.db import transaction, reset_queries
from django.db import reset_queries
from django.db.models import Q
import dogstats_wrapper as dog_stats_api
from pytz import UTC

View File

@@ -2,7 +2,6 @@
Tests of the LMS XBlock Runtime and associated utilities
"""
from django.contrib.auth.models import User
from django.conf import settings
from ddt import ddt, data
from django.test import TestCase

View File

@@ -14,7 +14,7 @@ import logging
from xmodule_django.models import CourseKeyField, UsageKeyField
from provider.utils import short_token, long_token
from provider.utils import short_token
log = logging.getLogger("edx.lti_provider")

View File

@@ -1,7 +1,7 @@
"""
Views for course info API
"""
from django.http import Http404
from rest_framework import generics
from rest_framework.response import Response

View File

@@ -3,7 +3,7 @@ Script for retiring order that went through cybersource but weren't
marked as "purchased" in the db
"""
from django.core.management.base import BaseCommand, CommandError
from django.core.management.base import BaseCommand
from shoppingcart.models import Order
from shoppingcart.exceptions import UnexpectedOrderItemStatus, InvalidStatusToRetire

View File

@@ -6,7 +6,6 @@ import json
from collections import OrderedDict
from django.test.client import Client
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from survey.models import SurveyForm, SurveyAnswer

View File

@@ -1,6 +1,6 @@
""" Tests for course_team reindex command """
import ddt
import mock
from mock import patch
from django.core.management import call_command, CommandError

View File

@@ -26,7 +26,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.core.cache import cache
from django.dispatch import receiver
from django.db import models, transaction, IntegrityError
from django.db import models, transaction
from django.utils.translation import ugettext as _, ugettext_lazy
from boto.s3.connection import S3Connection

View File

@@ -23,7 +23,7 @@ from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _, ugettext_lazy
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.views.generic.base import View, RedirectView
from django.views.generic.base import View
import analytics
from eventtracking import tracker