Merge pull request #2541 from edx/ned/remove-unused-imports
Remove unused imports.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test.utils import override_settings
|
||||
|
||||
import xmodule.modulestore.django
|
||||
|
||||
from courseware.tests.tests import LoginEnrollmentTestCase
|
||||
from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
@@ -3,10 +3,9 @@ Ideally, it will be the only place that needs to know about any special settings
|
||||
like DISABLE_START_DATES"""
|
||||
import logging
|
||||
from datetime import datetime, timedelta
|
||||
from functools import partial
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import Group, AnonymousUser
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
|
||||
from xmodule.course_module import CourseDescriptor
|
||||
from xmodule.error_module import ErrorDescriptor
|
||||
|
||||
@@ -4,7 +4,6 @@ django admin pages for courseware model
|
||||
|
||||
from courseware.models import StudentModule, OfflineComputedGrade, OfflineComputedGradeLog
|
||||
from ratelimitbackend import admin
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
admin.site.register(StudentModule)
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ from collections import defaultdict
|
||||
from fs.errors import ResourceNotFoundError
|
||||
import logging
|
||||
import inspect
|
||||
import re
|
||||
|
||||
from path import path
|
||||
from django.http import Http404
|
||||
|
||||
@@ -16,7 +16,6 @@ from path import path
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.contentstore.django import contentstore
|
||||
from xmodule.modulestore.xml_exporter import export_to_xml
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ Mock LTI server for manual testing.
|
||||
Used for manual testing and testing on sandbox.
|
||||
"""
|
||||
|
||||
import threading
|
||||
from mock_lti_server import MockLTIServer
|
||||
|
||||
server_port = 8034
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
"""
|
||||
Test for Mock_LTI_Server
|
||||
"""
|
||||
import mock
|
||||
from mock import Mock
|
||||
import unittest
|
||||
import threading
|
||||
import textwrap
|
||||
import urllib
|
||||
import requests
|
||||
from mock_lti_server import MockLTIServer
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ Tests related to the Microsites feature
|
||||
"""
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test.utils import override_settings
|
||||
from unittest import skip
|
||||
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ from django.test.utils import override_settings
|
||||
|
||||
# Need access to internal func to put users in the right group
|
||||
from courseware import grades
|
||||
from courseware.model_data import FieldDataCache
|
||||
from courseware.models import StudentModule
|
||||
|
||||
from xmodule.modulestore.django import modulestore, editable_modulestore
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import logging
|
||||
import urllib
|
||||
|
||||
from functools import partial
|
||||
from collections import defaultdict
|
||||
|
||||
from django.conf import settings
|
||||
@@ -10,7 +9,7 @@ from django.core.exceptions import PermissionDenied
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||
from django.http import Http404, HttpResponse
|
||||
from django.shortcuts import redirect
|
||||
from edxmako.shortcuts import render_to_response, render_to_string
|
||||
from django_future.csrf import ensure_csrf_cookie
|
||||
@@ -20,12 +19,11 @@ from markupsafe import escape
|
||||
|
||||
from courseware import grades
|
||||
from courseware.access import has_access
|
||||
from courseware.courses import (get_courses, get_course_with_access,
|
||||
get_courses_by_university, sort_by_announcement)
|
||||
from courseware.courses import get_courses, get_course_with_access, sort_by_announcement
|
||||
import courseware.tabs as tabs
|
||||
from courseware.masquerade import setup_masquerade
|
||||
from courseware.model_data import FieldDataCache
|
||||
from .module_render import toc_for_course, get_module_for_descriptor, get_module
|
||||
from .module_render import toc_for_course, get_module_for_descriptor
|
||||
from courseware.models import StudentModule, StudentModuleHistory
|
||||
from course_modes.models import CourseMode
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ from django.views.decorators.http import require_POST, require_GET
|
||||
from django.views.decorators import csrf
|
||||
from django.core.files.storage import get_storage_class
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from courseware.courses import get_course_with_access, get_course_by_id
|
||||
@@ -26,7 +25,6 @@ from course_groups.cohorts import get_cohort_id, is_commentable_cohorted
|
||||
from django_comment_client.utils import JsonResponse, JsonError, extract, add_courseware_context
|
||||
|
||||
from django_comment_client.permissions import check_permissions_by_view, cached_has_permission
|
||||
from django_comment_common.models import Role
|
||||
from courseware.access import has_access
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
from django.conf import settings
|
||||
from .mustache_helpers import mustache_helpers
|
||||
from functools import partial
|
||||
from mako.template import Template
|
||||
|
||||
from .utils import extend_content, merge_dict, render_mustache
|
||||
import django_comment_client.settings as cc_settings
|
||||
|
||||
import pystache_custom as pystache
|
||||
import urllib
|
||||
import os
|
||||
|
||||
|
||||
@@ -30,4 +23,3 @@ def include_mustache_templates():
|
||||
for file_name in os.listdir(mustache_dir)
|
||||
if is_valid_file_name(file_name)
|
||||
)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from django.core.urlresolvers import reverse
|
||||
from foldit.views import foldit_ops, verify_code
|
||||
from foldit.models import PuzzleComplete, Score
|
||||
from student.models import unique_id_for_user
|
||||
from student.tests.factories import CourseEnrollmentFactory, UserFactory, UserProfileFactory
|
||||
from student.tests.factories import CourseEnrollmentFactory, UserFactory
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from pytz import UTC
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from datetime import datetime
|
||||
import json
|
||||
from mock import patch, ANY
|
||||
from mock import patch
|
||||
from pytz import UTC
|
||||
|
||||
from django.test.utils import override_settings
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Instructor Dashboard Views
|
||||
"""
|
||||
from functools import partial
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
from django_future.csrf import ensure_csrf_cookie
|
||||
|
||||
@@ -9,7 +9,6 @@ import re
|
||||
import requests
|
||||
|
||||
from collections import defaultdict, OrderedDict
|
||||
from functools import partial
|
||||
from markupsafe import escape
|
||||
from requests.status_codes import codes
|
||||
from StringIO import StringIO
|
||||
|
||||
@@ -6,7 +6,6 @@ from decimal import Decimal
|
||||
import pytz
|
||||
import logging
|
||||
import smtplib
|
||||
import unicodecsv
|
||||
|
||||
from boto.exception import BotoServerError # this is a super-class of SESError and catches connection errors
|
||||
from django.dispatch import receiver
|
||||
@@ -34,7 +33,7 @@ from util.query import use_read_replica_if_available
|
||||
from verify_student.models import SoftwareSecurePhotoVerification
|
||||
|
||||
from .exceptions import (InvalidCartItem, PurchasedCallbackException, ItemAlreadyInCartException,
|
||||
AlreadyEnrolledInCourseException, CourseDoesNotExistException, ReportException)
|
||||
AlreadyEnrolledInCourseException, CourseDoesNotExistException)
|
||||
|
||||
from microsite_configuration.middleware import MicrositeConfiguration
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
Tests for the Shopping Cart Models
|
||||
"""
|
||||
import smtplib
|
||||
import StringIO
|
||||
from textwrap import dedent
|
||||
from boto.exception import BotoServerError # this is a super-class of SESError and catches connection errors
|
||||
|
||||
from mock import patch, MagicMock, sentinel
|
||||
@@ -17,7 +15,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
from courseware.tests.tests import TEST_DATA_MONGO_MODULESTORE
|
||||
from shoppingcart.models import (Order, OrderItem, CertificateItem, InvalidCartItem, PaidCourseRegistration,
|
||||
OrderItemSubclassPK, PaidCourseRegistrationAnnotation)
|
||||
OrderItemSubclassPK)
|
||||
from student.tests.factories import UserFactory
|
||||
from student.models import CourseEnrollment
|
||||
from course_modes.models import CourseMode
|
||||
|
||||
@@ -20,7 +20,7 @@ from student.models import CourseEnrollment
|
||||
from course_modes.models import CourseMode
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from shoppingcart.processors import render_purchase_form_html
|
||||
from mock import patch, Mock, sentinel
|
||||
from mock import patch, Mock
|
||||
from shoppingcart.views import initialize_report
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from django.conf.urls import patterns, include, url
|
||||
from django.conf.urls import patterns, url
|
||||
from django.conf import settings
|
||||
|
||||
urlpatterns = patterns('shoppingcart.views', # nopep8
|
||||
|
||||
@@ -10,8 +10,6 @@ photo verification process as generic as possible.
|
||||
"""
|
||||
from datetime import datetime, timedelta
|
||||
from email.utils import formatdate
|
||||
from hashlib import md5
|
||||
import base64
|
||||
import functools
|
||||
import json
|
||||
import logging
|
||||
|
||||
@@ -2,11 +2,8 @@
|
||||
from datetime import timedelta, datetime
|
||||
import json
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
from nose.tools import (
|
||||
assert_in, assert_is_none, assert_equals, assert_not_equals, assert_raises,
|
||||
assert_true, assert_false
|
||||
)
|
||||
from mock import MagicMock, patch
|
||||
from nose.tools import assert_is_none, assert_equals, assert_raises, assert_true, assert_false
|
||||
from mock import patch
|
||||
import pytz
|
||||
from django.test import TestCase
|
||||
from courseware.tests.tests import TEST_DATA_MONGO_MODULESTORE
|
||||
@@ -20,8 +17,6 @@ from verify_student.models import (
|
||||
SoftwareSecurePhotoVerification, VerificationException,
|
||||
)
|
||||
from reverification.tests.factories import MidcourseReverificationWindowFactory
|
||||
from util.testing import UrlResetMixin
|
||||
import verify_student.models
|
||||
|
||||
FAKE_SETTINGS = {
|
||||
"SOFTWARE_SECURE": {
|
||||
|
||||
@@ -10,7 +10,7 @@ verify_student/start?course_id=MITx/6.002x/2013_Spring # create
|
||||
|
||||
"""
|
||||
import urllib
|
||||
from mock import patch, Mock, ANY
|
||||
from mock import patch, Mock
|
||||
import pytz
|
||||
from datetime import timedelta, datetime
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from django.conf.urls import include, patterns, url
|
||||
from django.views.generic import TemplateView
|
||||
from django.conf.urls import patterns, url
|
||||
|
||||
from verify_student import views
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ import json
|
||||
import logging
|
||||
import decimal
|
||||
import datetime
|
||||
import crum
|
||||
from track.views import server_track
|
||||
from pytz import UTC
|
||||
|
||||
from edxmako.shortcuts import render_to_response
|
||||
@@ -21,7 +19,6 @@ from django.views.decorators.http import require_POST
|
||||
from django.views.generic.base import View
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.http import urlencode
|
||||
from django.contrib.auth.decorators import login_required
|
||||
|
||||
from course_modes.models import CourseMode
|
||||
|
||||
@@ -19,7 +19,7 @@ import logging
|
||||
logging.basicConfig(filename=TEST_ROOT / "log" / "lms_acceptance.log", level=logging.ERROR)
|
||||
|
||||
import os
|
||||
from random import choice, randint
|
||||
from random import choice
|
||||
import string
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user