Remove unused imports

This commit is contained in:
Ned Batchelder
2018-11-06 21:41:53 -05:00
parent 6e2e5d0e03
commit 046fe60913
25 changed files with 8 additions and 38 deletions

View File

@@ -4,7 +4,6 @@ from django.conf import settings
from django.contrib import admin
from django.http.request import QueryDict
from django.utils.translation import ugettext_lazy as _
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from pytz import UTC, timezone
@@ -22,7 +21,6 @@ from course_modes.models import CourseMode, CourseModeExpirationConfig
from lms.djangoapps.verify_student import models as verification_models
from openedx.core.lib.courses import clean_course_id
from util.date_utils import get_time_display
from xmodule.modulestore.django import modulestore
COURSE_MODE_SLUG_CHOICES = [(key, enrollment_mode['display_name']) for key, enrollment_mode in six.iteritems(settings.COURSE_ENROLLMENT_MODES)]

View File

@@ -40,11 +40,7 @@ from openedx.core.djangoapps.user_api.models import (
from openedx.core.lib.django_test_client_utils import get_absolute_url
from openedx.features.enterprise_support.tests import FAKE_ENTERPRISE_CUSTOMER
from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseServiceMockMixin
from student.models import (
CourseEnrollment,
get_retired_username_by_username,
get_retired_email_by_email,
)
from student.models import CourseEnrollment
from student.roles import CourseStaffRole
from student.tests.factories import AdminFactory, UserFactory, SuperuserFactory
from util.models import RateLimitConfiguration

View File

@@ -6,8 +6,6 @@ consist primarily of authentication, request validation, and serialization.
import logging
from course_modes.models import CourseMode
from django.db import transaction
from django.contrib.auth import get_user_model
from django.core.exceptions import ObjectDoesNotExist
from django.utils.decorators import method_decorator
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication

View File

@@ -3,7 +3,6 @@ import logging
from django.db import IntegrityError, transaction
from django.db.models import Q
from django.http import HttpResponseBadRequest
from django.utils import timezone
from django_filters.rest_framework import DjangoFilterBackend
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from edx_rest_framework_extensions.paginators import DefaultPagination

View File

@@ -3,10 +3,8 @@
from unittest import skipUnless
import ddt
import os
from django.conf import settings
from django.test import TestCase
from paver.easy import call_task
from mock import patch
from pipeline_mako import compressed_css, compressed_js, render_require_js_path_overrides

View File

@@ -2,7 +2,7 @@ import logging
import unicodecsv
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand, CommandError
from django.core.management.base import BaseCommand
from django.db.models import Q
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey

View File

@@ -5,7 +5,7 @@ Django users, set/unset permission bits, and associate groups by name.
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import is_password_usable
from django.contrib.auth.models import Group, BaseUserManager
from django.contrib.auth.models import Group
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from django.utils.translation import gettext as _

View File

@@ -7,7 +7,7 @@ from testfixtures import LogCapture
from course_modes.tests.factories import CourseModeFactory
from student.tests.factories import UserFactory
from student.models import CourseEnrollment, User
from student.models import CourseEnrollment
LOGGER_NAME = 'student.management.commands.bulk_unenroll'

View File

@@ -30,7 +30,7 @@ from django.contrib.auth.models import User
from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.core.cache import cache
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import IntegrityError, models, transaction
from django.db import IntegrityError, models
from django.db.models import Count, Q
from django.db.models.signals import post_save, pre_save
from django.db.utils import ProgrammingError

View File

@@ -7,7 +7,6 @@ from django.urls import reverse
from django.test import TestCase, override_settings
from mock import patch
from edxmako.shortcuts import render_to_string
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api.config.waffle import PREVENT_AUTH_USER_WRITES, SYSTEM_MAINTENANCE_MSG, waffle
from student.models import Registration

View File

@@ -17,14 +17,12 @@ from edxmako.shortcuts import render_to_string
from openedx.core.djangoapps.ace_common.tests.mixins import EmailTemplateTagMixin
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration
from openedx.core.djangoapps.user_api.config.waffle import PREVENT_AUTH_USER_WRITES, SYSTEM_MAINTENANCE_MSG, waffle
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, CacheIsolationMixin
from student.models import (
PendingEmailChange,
Registration,
UserProfile,
get_retired_email_by_email
)
from openedx.core.lib.request_utils import safe_get_host
from student.tests.factories import PendingEmailChangeFactory, RegistrationFactory, UserFactory

View File

@@ -13,7 +13,6 @@ from course_modes.tests.factories import CourseModeFactory
from openedx.core.djangoapps.embargo.test_utils import restrict_course
from student.models import (
CourseEnrollment,
CourseEnrollmentAllowed,
CourseFullError,
EnrollmentClosedError,
SCORE_RECALCULATION_DELAY_ON_ENROLLMENT_UPDATE,

View File

@@ -7,7 +7,7 @@ from django.db.utils import IntegrityError
from django.test import TestCase
from django_countries.fields import Country
from student.models import CourseEnrollmentAllowed, PasswordHistory
from student.models import CourseEnrollmentAllowed
from student.tests.factories import UserFactory, CourseEnrollmentAllowedFactory
from student.tests.tests import UserSettingsEventTestMixin

View File

@@ -5,7 +5,6 @@ import time
import unittest
import ddt
import pytest
from django.contrib.auth.models import User
from django.core.management import call_command
from django.db import IntegrityError, connection

View File

@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
"""Tests for util.password_policy_validators module."""
import mock
import unittest
from ddt import data, ddt, unpack
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.test.utils import override_settings

View File

@@ -9,7 +9,6 @@ import numbers
import operator
import numpy
import scipy.constants
from pyparsing import (
CaselessLiteral,
Combine,

View File

@@ -9,7 +9,6 @@ import random
import re
import unittest
import os
import uuid
import ddt
from contracts import contract

View File

@@ -1,7 +1,6 @@
import datetime
import random
import unittest
import uuid
import os
import mock
import pytest

View File

@@ -4,7 +4,6 @@ Helper classes and methods for running modulestore tests without Django.
from uuid import uuid4
import io
import os
import random
from contextlib import contextmanager, nested
from importlib import import_module

View File

@@ -2,9 +2,8 @@
Tests that check that we ignore the appropriate files when importing courses.
"""
import unittest
import ddt
from mock import Mock
import os
from xmodule.modulestore.xml_importer import StaticContentImporter
from opaque_keys.edx.locator import CourseLocator
from xmodule.tests import DATA_DIR

View File

@@ -8,8 +8,6 @@ from uuid import uuid4
from pymongo import ReadPreference
from django.conf import settings
from xmodule.mongo_utils import connect_to_mongodb

View File

@@ -11,7 +11,6 @@ import json
import ddt
from fs.memoryfs import MemoryFS
from mock import Mock, patch
import six
from . import get_test_system
from .helpers import StubUserService

View File

@@ -20,8 +20,6 @@ from xmodule.util.xmodule_django import add_webpack_to_fragment
from xmodule.x_module import STUDENT_VIEW, XModuleFields
from xmodule.xml_module import XmlParserMixin
import webpack_loader.utils
log = logging.getLogger(__name__)
# HACK: This shouldn't be hard-coded to two types

View File

@@ -12,11 +12,9 @@ import logging
from pysrt import SubRipTime, SubRipItem, SubRipFile
from pysrt.srtexc import Error
from lxml import etree
from opaque_keys.edx.locator import BlockUsageLocator
from HTMLParser import HTMLParser
from six import text_type
from xmodule.modulestore.django import modulestore
from xmodule.exceptions import NotFoundError
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore

View File

@@ -25,7 +25,6 @@ from .transcripts_utils import (
clean_video_id,
get_or_create_sjson,
generate_sjson_for_all_speeds,
save_to_store,
subs_filename,
Transcript,
TranscriptException,