Commit 30aede6f by Ned Batchelder

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

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