Commit 59ad3ccb by Ned Batchelder

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

Remove unused imports
parents 3acf503e 7d799e34
......@@ -11,7 +11,7 @@ import ddt
from django.test import RequestFactory
from contentstore.views.course import _accessible_courses_list, _accessible_courses_list_from_groups, AccessListFallback
from contentstore.utils import delete_course_and_groups, reverse_course_url
from contentstore.utils import delete_course_and_groups
from contentstore.tests.utils import AjaxEnabledTestClient
from student.tests.factories import UserFactory
from student.roles import CourseInstructorRole, CourseStaffRole, GlobalStaff, OrgStaffRole, OrgInstructorRole
......
......@@ -4,7 +4,6 @@ Test finding orphans via the view and django config
import json
from contentstore.tests.utils import CourseTestCase
from student.models import CourseEnrollment
from xmodule.modulestore.django import modulestore
from contentstore.utils import reverse_course_url
......
......@@ -6,8 +6,6 @@ import copy
import textwrap
from mock import patch, Mock
from pymongo import MongoClient
from django.test.utils import override_settings
from django.conf import settings
from django.utils import translation
......
......@@ -16,7 +16,6 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.django import modulestore
from opaque_keys.edx.locator import CourseLocator
class LMSLinksTestCase(TestCase):
......
......@@ -7,7 +7,6 @@ import json
from django.conf import settings
from django.contrib.auth.models import User
from django.test.client import Client
from django.test.utils import override_settings
from opaque_keys.edx.locations import SlashSeparatedCourseKey, AssetLocation
from contentstore.utils import reverse_url
......@@ -17,7 +16,6 @@ from xmodule.contentstore.django import contentstore
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.inheritance import own_metadata
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.xml_importer import import_course_from_xml
......
......@@ -9,7 +9,6 @@ import logging
from django.contrib.auth.decorators import login_required
from django_future.csrf import ensure_csrf_cookie
from django.http import HttpResponse, HttpResponseBadRequest
from django.test import RequestFactory
from contentstore.views.helpers import create_xblock
from contentstore.views.item import delete_item
......
......@@ -24,7 +24,7 @@ from xblock.fields import Scope
from xblock.fragment import Fragment
import xmodule
from xmodule.tabs import StaticTab, CourseTabList
from xmodule.tabs import CourseTabList
from xmodule.modulestore import ModuleStoreEnum, EdxJSONEncoder
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError, InvalidLocationError
......@@ -47,7 +47,7 @@ from contentstore.views.preview import get_preview_fragment
from edxmako.shortcuts import render_to_string
from models.settings.course_grading import CourseGradingModel
from cms.lib.xblock.runtime import handler_url, local_resource_url
from opaque_keys.edx.keys import UsageKey, CourseKey
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locator import LibraryUsageLocator
from cms.lib.xblock.authoring_mixin import VISIBILITY_VIEW
......
......@@ -6,7 +6,6 @@ import ddt
from mock import Mock
from xblock.core import XBlock
from django.test import TestCase
from django.test.client import RequestFactory
from xblock.core import XBlockAside
......
""" Tests for tab functions (just primitive). """
import json
from contentstore.views import tabs
from contentstore.tests.utils import CourseTestCase
from django.test import TestCase
from contentstore.utils import reverse_course_url
from xmodule.x_module import STUDENT_VIEW
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.tabs import CourseTabList, WikiTab
from contentstore.utils import reverse_course_url
from xmodule.modulestore.django import modulestore
......
"""Tests for items views."""
import os
import copy
import json
import os
import tempfile
from uuid import uuid4
import copy
import textwrap
from pymongo import MongoClient
from uuid import uuid4
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
......
......@@ -6,14 +6,11 @@ import ddt
import json
import unittest
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from rest_framework import status
from django.conf import settings
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase, mixed_store_config
)
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, CourseAboutFactory
from student.tests.factories import UserFactory
......
......@@ -3,13 +3,10 @@ Tests specific to the Data Aggregation Layer of the Course About API.
"""
import unittest
from django.test.utils import override_settings
from datetime import datetime
from django.conf import settings
from nose.tools import raises
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase, mixed_store_config
)
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from student.tests.factories import UserFactory
from course_about import data
......
......@@ -12,9 +12,7 @@ from rest_framework import status
from django.conf import settings
from datetime import datetime
from mock import patch
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase, mixed_store_config
)
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, CourseAboutFactory
from student.tests.factories import UserFactory
from course_about.serializers import course_image_url
......
......@@ -3,14 +3,11 @@ import decimal
import ddt
from mock import patch
from django.conf import settings
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from pytz import timezone
from datetime import datetime
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase, mixed_store_config
)
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from util.date_utils import get_time_display
from util.testing import UrlResetMixin
......
from django.conf.urls import include, patterns, url
from django.conf.urls import patterns, url
from django.conf import settings
from django.views.generic import TemplateView
from course_modes import views
urlpatterns = patterns(
......
......@@ -6,7 +6,6 @@ import decimal
from ipware.ip import get_ip
from django.core.urlresolvers import reverse
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import redirect
from django.views.generic.base import View
......
......@@ -7,11 +7,15 @@ import logging
from django.contrib.auth.models import User
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import modulestore
from enrollment.errors import CourseNotFoundError, CourseEnrollmentClosedError, CourseEnrollmentFullError, \
CourseEnrollmentExistsError, UserNotFoundError
from enrollment.errors import (
CourseNotFoundError, CourseEnrollmentClosedError, CourseEnrollmentFullError,
CourseEnrollmentExistsError, UserNotFoundError,
)
from enrollment.serializers import CourseEnrollmentSerializer, CourseField
from student.models import CourseEnrollment, NonExistentCourseError, CourseEnrollmentException, EnrollmentClosedError, \
CourseFullError, AlreadyEnrolledError
from student.models import (
CourseEnrollment, NonExistentCourseError, EnrollmentClosedError,
CourseFullError, AlreadyEnrolledError,
)
log = logging.getLogger(__name__)
......
......@@ -7,14 +7,13 @@ from mock import patch
from nose.tools import raises
import unittest
from django.test.utils import override_settings
from django.conf import settings
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase, mixed_store_config
)
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from enrollment.errors import CourseNotFoundError, UserNotFoundError, CourseEnrollmentClosedError, \
CourseEnrollmentFullError, CourseEnrollmentExistsError
from enrollment.errors import (
CourseNotFoundError, UserNotFoundError, CourseEnrollmentClosedError,
CourseEnrollmentFullError, CourseEnrollmentExistsError,
)
from student.tests.factories import UserFactory, CourseModeFactory
from student.models import CourseEnrollment, EnrollmentClosedError, CourseFullError, AlreadyEnrolledError
from enrollment import data
......
......@@ -21,7 +21,6 @@ from external_auth.views import (
)
from mock import patch
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from student.views import create_account, change_enrollment
from student.models import UserProfile, CourseEnrollment
from student.tests.factories import UserFactory
......
......@@ -47,8 +47,6 @@ from ratelimitbackend.exceptions import RateLimitException
import student.views
from xmodule.modulestore.django import modulestore
from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.exceptions import ItemNotFoundError
from opaque_keys.edx.locations import SlashSeparatedCourseKey
log = logging.getLogger("edx.external_auth")
......
......@@ -6,11 +6,9 @@ import pygeoip
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.utils import override_settings
from django.test.client import RequestFactory
from geoinfo.middleware import CountryMiddleware
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from student.tests.factories import UserFactory, AnonymousUserFactory
......
# Register signal handlers
# pylint: disable=unused-imports
import signals
import exceptions
......@@ -5,9 +5,7 @@ from datetime import timedelta, datetime
import pytz
from django.core.exceptions import ValidationError
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from reverification.models import MidcourseReverificationWindow
from reverification.tests.factories import MidcourseReverificationWindowFactory
from xmodule.modulestore.tests.factories import CourseFactory
......
......@@ -9,7 +9,7 @@ from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from student.forms import AccountCreationForm
from student.models import CourseEnrollment, Registration, create_comments_service_user
from student.models import CourseEnrollment, create_comments_service_user
from student.views import _do_create_account, AccountValidationError
from track.management.tracked_command import TrackedCommand
......
......@@ -18,8 +18,6 @@ from pytz import UTC
import uuid
from collections import defaultdict, OrderedDict
import dogstats_wrapper as dog_stats_api
from django.db.models import Q
import pytz
from urllib import urlencode
from django.utils.translation import ugettext as _, ugettext_lazy
......@@ -28,7 +26,7 @@ from django.utils import timezone
from django.contrib.auth.models import User
from django.contrib.auth.hashers import make_password
from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.db import models, IntegrityError, transaction
from django.db import models, IntegrityError
from django.db.models import Count
from django.dispatch import receiver, Signal
from django.core.exceptions import ObjectDoesNotExist
......@@ -40,8 +38,6 @@ from eventtracking import tracker
from importlib import import_module
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore import Location
from opaque_keys import InvalidKeyError
import lms.lib.comment_client as cc
from util.query import use_read_replica_if_available
......@@ -54,8 +50,6 @@ from functools import total_ordering
from certificates.models import GeneratedCertificate
from course_modes.models import CourseMode
from ratelimitbackend import admin
import analytics
UNENROLL_DONE = Signal(providing_args=["course_enrollment", "skip_refund"])
......
......@@ -8,15 +8,12 @@ import unittest
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from mock import patch
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MOCK_MODULESTORE, TEST_DATA_MIXED_TOY_MODULESTORE
)
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
from xmodule.modulestore.tests.factories import CourseFactory
# This import is for an lms djangoapp.
......
......@@ -6,7 +6,6 @@ import unittest
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers import reverse, NoReverseMatch
......@@ -20,7 +19,7 @@ from student.tests.factories import UserFactory, RegistrationFactory, UserProfil
from student.views import login_oauth_token
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MOCK_MODULESTORE
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
class LoginTest(TestCase):
......
......@@ -7,7 +7,6 @@ import ddt
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from util.testing import UrlResetMixin
from xmodule.modulestore.tests.factories import CourseFactory
......
......@@ -5,7 +5,6 @@ import unittest
import ddt
from mock import patch
from pytz import UTC
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
......
......@@ -3,7 +3,6 @@ Student Views
"""
import datetime
import logging
import re
import uuid
import time
import json
......@@ -46,7 +45,6 @@ from social.apps.django_app import utils as social_utils
from social.backends import oauth as social_oauth
from edxmako.shortcuts import render_to_response, render_to_string
from mako.exceptions import TopLevelLookupException
from course_modes.models import CourseMode
from shoppingcart.api import order_history
......
......@@ -12,7 +12,6 @@ not possible to have this LTI multiple times on a single page in LMS.
from uuid import uuid4
import textwrap
import urllib
import re
from oauthlib.oauth1.rfc5849 import signature, parameters
import oauthlib.oauth1
import hashlib
......
......@@ -5,7 +5,7 @@ Unit tests for stub ORA implementation.
import unittest
import requests
import json
from ..ora import StubOraService, StubOraHandler, StudentState
from ..ora import StubOraService, StudentState
class StubOraServiceTest(unittest.TestCase):
......
......@@ -6,7 +6,7 @@ import mock
import unittest
import json
import requests
from ..xqueue import StubXQueueService, StubXQueueHandler
from ..xqueue import StubXQueueService
class FakeTimer(object):
......
from __future__ import absolute_import
from uuid import uuid4
from mock import patch
from django.test import TestCase
......
......@@ -3,7 +3,7 @@ import mock
import unittest
from django.test import TestCase
from django.core.urlresolvers import reverse, NoReverseMatch
from django.core.urlresolvers import reverse
from django.conf import settings
from track.models import TrackingLog
from track.views import user_track
......
......@@ -13,7 +13,7 @@ from django_future.csrf import csrf_exempt
from eventtracking import tracker
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from util.json_request import expect_json, JsonResponse
from util.json_request import expect_json
log = logging.getLogger(__name__)
......
......@@ -6,9 +6,7 @@ import warnings
from django.db import models
from django.core.exceptions import ValidationError
from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location
from opaque_keys.edx.keys import CourseKey, UsageKey, BlockTypeKey
from opaque_keys.edx.locator import Locator
from south.modelsinspector import add_introspection_rules
......
......@@ -41,7 +41,6 @@ from capa.tests.response_xml_factory import (
TrueFalseResponseXMLFactory,
)
from capa.util import convert_files_to_filenames
from capa.util import compare_with_tolerance
from capa.xqueue_interface import dateformat
......
......@@ -2,7 +2,7 @@
Tests capa util
"""
import unittest
import textwrap
from . import test_capa_system
from capa.util import compare_with_tolerance, sanitize_html
......
......@@ -17,14 +17,12 @@ except ImportError:
# pylint: disable=invalid-name
dog_stats_api = None
from pkg_resources import resource_string
from capa.capa_problem import LoncapaProblem, LoncapaSystem
from capa.responsetypes import StudentInputError, \
ResponseError, LoncapaProblemError
from capa.util import convert_files_to_filenames
from .progress import Progress
from xmodule.exceptions import NotFoundError, ProcessingError
from xmodule.exceptions import NotFoundError
from xblock.fields import Scope, String, Boolean, Dict, Integer, Float
from .fields import Timedelta, Date
from django.utils.timezone import UTC
......
......@@ -4,8 +4,6 @@ LibraryContent: The XBlock used to include blocks from a library in a course.
"""
import json
from lxml import etree
from bson.objectid import ObjectId, InvalidId
from collections import namedtuple
from copy import copy
from capa.responsetypes import registry
from gettext import ngettext
......
......@@ -69,7 +69,6 @@ from xml.sax.saxutils import escape
from xmodule.editing_module import MetadataOnlyEditingDescriptor
from xmodule.raw_module import EmptyDataRawDescriptor
from xmodule.x_module import XModule, module_attr
from xmodule.course_module import CourseDescriptor
from xmodule.lti_2_util import LTI20ModuleMixin, LTIError
from pkg_resources import resource_string
from xblock.core import String, Scope, List, XBlock
......
......@@ -4,4 +4,5 @@ Backwards compatibility for old pointers to draft module store
This modulestore has been moved to xmodule.modulestore.mongo.draft
"""
# pylint: disable=unused-import
from xmodule.modulestore.mongo.draft import DraftModuleStore
......@@ -15,7 +15,7 @@ from xmodule.modulestore import ModuleStoreEnum, SortedAssetList, IncorrectlySor
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.test_cross_modulestore_import_export import (
MIXED_MODULESTORE_BOTH_SETUP, MODULESTORE_SETUPS, MongoContentstoreBuilder,
MIXED_MODULESTORE_BOTH_SETUP, MODULESTORE_SETUPS,
XmlModulestoreBuilder, MixedModulestoreBuilder
)
......
......@@ -21,7 +21,6 @@ from xblock.core import XBlock
from xblock.fields import Scope, Reference, ReferenceList, ReferenceValueDict
from xblock.runtime import KeyValueStore
from xblock.exceptions import InvalidScopeError
from xblock.plugin import Plugin
from xmodule.tests import DATA_DIR
from opaque_keys.edx.locations import Location
......
# This class gives a common interface for logging into the grading controller
import json
import logging
import requests
import dogstats_wrapper as dog_stats_api
from lxml import etree
from requests.exceptions import RequestException, ConnectionError, HTTPError
from .combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError
from lxml import etree
log = logging.getLogger(__name__)
......
"""Tests for classes defined in fields.py."""
import datetime
import unittest
from django.utils.timezone import UTC
from xmodule.fields import Date, Timedelta, RelativeTime
from xmodule.timeinfo import TimeInfo
import time
class DateTest(unittest.TestCase):
......
import json
from textwrap import dedent
from StringIO import StringIO
from xmodule.modulestore.xml import XMLModuleStore
from xmodule.tests import DATA_DIR, get_test_system
from xmodule.tests import DATA_DIR
from StringIO import StringIO
OPEN_ENDED_GRADING_INTERFACE = {
'url': 'blah/',
......
......@@ -4,7 +4,7 @@ Handlers for video module.
StudentViewHandlers are handlers for video module instance.
StudioViewHandlers are handlers for video descriptor instance.
"""
import os
import json
import logging
from webob import Response
......
"""
Tests for branding page
"""
import datetime
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponseRedirect
from django.test.utils import override_settings
from django.test.client import RequestFactory
from pytz import UTC
from mock import patch, Mock
from edxmako.shortcuts import render_to_response
from branding.views import index
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from edxmako.tests import mako_middleware_process_request
import student.views
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
......@@ -34,7 +34,7 @@ from django.core.mail import EmailMultiAlternatives, get_connection
from django.core.urlresolvers import reverse
from bulk_email.models import (
CourseEmail, Optout, CourseEmailTemplate,
CourseEmail, Optout,
SEND_TO_MYSELF, SEND_TO_ALL, TO_OPTIONS,
SEND_TO_STAFF,
)
......
......@@ -9,9 +9,7 @@ from django.core import mail
from django.core.management import call_command
from django.core.urlresolvers import reverse
from django.conf import settings
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from student.tests.factories import UserFactory, AdminFactory, CourseEnrollmentFactory
from student.models import CourseEnrollment
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
......@@ -15,7 +15,6 @@ from django.test.utils import override_settings
from bulk_email.models import Optout
from courseware.tests.factories import StaffFactory, InstructorFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from instructor_task.subtasks import update_subtask_status
from student.roles import CourseStaffRole
from student.models import CourseEnrollment
......
......@@ -5,7 +5,6 @@ Unit tests for handling email sending errors
from itertools import cycle
from celery.states import SUCCESS, RETRY
from django.test.utils import override_settings
from django.conf import settings
from django.core.management import call_command
from django.core.urlresolvers import reverse
......@@ -16,7 +15,6 @@ from smtplib import SMTPDataError, SMTPServerDisconnected, SMTPConnectError
from bulk_email.models import CourseEmail, SEND_TO_ALL
from bulk_email.tasks import perform_delegate_email_batches, send_course_email
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from instructor_task.models import InstructorTask
from instructor_task.subtasks import (
initialize_subtask_info,
......
......@@ -3,14 +3,11 @@
Unit tests for bulk-email-related forms.
"""
from django.conf import settings
from django.test.utils import override_settings
from mock import patch
from bulk_email.models import CourseAuthorization, CourseEmailTemplate
from bulk_email.forms import CourseAuthorizationAdminForm, CourseEmailTemplateForm
from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MOCK_MODULESTORE, TEST_DATA_MIXED_TOY_MODULESTORE
)
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
......
......@@ -6,12 +6,9 @@ from django.core.management.base import BaseCommand, CommandError
from certificates.models import GeneratedCertificate
from django.contrib.auth.models import User
from optparse import make_option
from django.conf import settings
from opaque_keys import InvalidKeyError
from xmodule.course_module import CourseDescriptor
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.django import modulestore
from django.db.models import Count
......
from factory.django import DjangoModelFactory
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from certificates.models import GeneratedCertificate, CertificateStatuses, CertificateHtmlViewConfiguration
......
......@@ -4,7 +4,7 @@ import ddt
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
from mock import patch, Mock
from mock import patch
from opaque_keys.edx.locator import CourseLocator
from xmodule.modulestore.tests.factories import CourseFactory
......
......@@ -4,7 +4,6 @@ Tests for the certificates models.
from mock import patch
from django.conf import settings
from django.test import TestCase
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
......@@ -4,24 +4,23 @@ Tests for class dashboard (Metrics tab in instructor dashboard)
import json
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from mock import patch
from capa.tests.response_xml_factory import StringResponseXMLFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from courseware.tests.factories import StudentModuleFactory
from student.tests.factories import UserFactory, CourseEnrollmentFactory, AdminFactory
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from class_dashboard.dashboard_data import (get_problem_grade_distribution, get_sequential_open_distrib,
get_problem_set_grade_distrib, get_d3_problem_grade_distrib,
get_d3_sequential_open_distrib, get_d3_section_grade_distrib,
get_section_display_name, get_array_section_has_problem,
get_students_opened_subsection, get_students_problem_grades,
)
from class_dashboard.dashboard_data import (
get_problem_grade_distribution, get_sequential_open_distrib,
get_problem_set_grade_distrib, get_d3_problem_grade_distrib,
get_d3_sequential_open_distrib, get_d3_section_grade_distrib,
get_section_display_name, get_array_section_has_problem,
get_students_opened_subsection, get_students_problem_grades,
)
from class_dashboard.views import has_instructor_access_for_class
USER_COUNT = 11
......
......@@ -7,9 +7,7 @@ from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from django.test.utils import override_settings
from courseware.tests.factories import InstructorFactory, StaffFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from wiki.models import URLPath
from course_wiki.views import get_or_create_root
......
......@@ -3,14 +3,12 @@ Tests for wiki middleware.
"""
from django.test.client import Client
from django.test.utils import override_settings
from wiki.models import URLPath
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from courseware.tests.factories import InstructorFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from course_wiki.views import get_or_create_root
......
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from courseware.tests.tests import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
......@@ -29,7 +29,6 @@ from capa.xqueue_interface import XQueueInterface
from courseware.access import has_access, get_user_role
from courseware.masquerade import setup_masquerade
from courseware.model_data import FieldDataCache, DjangoKeyValueStore
from courseware.models import StudentModule
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
from lms.djangoapps.lms_xblock.runtime import LmsModuleSystem, unquote_slashes, quote_slashes
from lms.djangoapps.lms_xblock.models import XBlockAsidesConfig
......
......@@ -11,9 +11,8 @@ from mock import patch
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from course_modes.models import CourseMode
from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MOCK_MODULESTORE, TEST_DATA_MIXED_CLOSED_MODULESTORE
)
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_CLOSED_MODULESTORE
from student.models import CourseEnrollment
from student.tests.factories import UserFactory, CourseEnrollmentAllowedFactory
from shoppingcart.models import Order, PaidCourseRegistration
......
"""
Test the course_info xblock
"""
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
import mock
from django.core.urlresolvers import reverse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MOCK_MODULESTORE, TEST_DATA_MIXED_CLOSED_MODULESTORE
)
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_CLOSED_MODULESTORE
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from .helpers import LoginEnrollmentTestCase
......
from django.test import TestCase
from django.test.utils import override_settings
from xmodule.modulestore.django import modulestore
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
class TestDraftModuleStore(TestCase):
"""
......
......@@ -3,16 +3,14 @@ Tests use cases related to LMS Entrance Exam behavior, such as gated content acc
"""
from django.conf import settings
from django.test.client import RequestFactory
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from courseware.model_data import FieldDataCache
from courseware.module_render import get_module, toc_for_course
from courseware.tests.factories import UserFactory, InstructorFactory
from courseware.courses import get_entrance_exam_content_info, get_entrance_exam_score
from milestones.models import MilestoneRelationshipType
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MOCK_MODULESTORE
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from util import milestones_helpers
from student.models import CourseEnrollment
......
......@@ -6,7 +6,6 @@ edx.org uses an edx footer but other instances use an Open edX footer.
from mock import patch
from django.test import TestCase
from django.test.utils import override_settings
class TestFooter(TestCase):
......
......@@ -2,12 +2,10 @@
Test grade calculation.
"""
from django.http import Http404
from django.test.utils import override_settings
from mock import patch
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from courseware.grades import grade, iterate_grades_for
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
......@@ -6,8 +6,6 @@ import re
from django.test import TestCase
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
@override_settings(LANGUAGES=(('eo', 'Esperanto'),))
class I18nTestCase(TestCase):
......
......@@ -8,10 +8,8 @@ import urllib
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from courseware.tests import BaseTestXmodule
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from courseware.views import get_course_lti_endpoints
from lms.djangoapps.lms_xblock.runtime import quote_slashes
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
......@@ -6,7 +6,6 @@ from mock import patch
from datetime import datetime
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.utils.timezone import UTC
from capa.tests.response_xml_factory import OptionResponseXMLFactory
......@@ -15,7 +14,7 @@ from courseware.tests.factories import StaffFactory
from courseware.tests.helpers import LoginEnrollmentTestCase, get_request_for_user
from student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MOCK_MODULESTORE
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import ItemFactory, CourseFactory
from xmodule.partitions.partitions import Group, UserPartition
......
......@@ -6,7 +6,6 @@ from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from courseware.tests.helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from course_modes.models import CourseMode
from xmodule.course_module import (
CATALOG_VISIBILITY_CATALOG_AND_ABOUT, CATALOG_VISIBILITY_NONE)
......
......@@ -3,14 +3,12 @@ Tests for courseware middleware
"""
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.test.client import RequestFactory
from django.http import Http404
from mock import patch
import courseware.courses as courses
from courseware.middleware import RedirectUnenrolledMiddleware
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
......
......@@ -11,7 +11,6 @@ from django.http import Http404, HttpResponse
from django.core.urlresolvers import reverse
from django.conf import settings
from django.test.client import RequestFactory
from django.test.utils import override_settings
from django.contrib.auth.models import AnonymousUser
from mock import MagicMock, patch, Mock
from opaque_keys.edx.keys import UsageKey, CourseKey
......@@ -30,8 +29,8 @@ from courseware.models import StudentModule
from courseware.tests.factories import StudentModuleFactory, UserFactory, GlobalStaffFactory
from courseware.tests.tests import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MOCK_MODULESTORE, TEST_DATA_MIXED_TOY_MODULESTORE,
TEST_DATA_XML_MODULESTORE, TEST_DATA_MIXED_CLOSED_MODULESTORE
TEST_DATA_MIXED_TOY_MODULESTORE,
TEST_DATA_XML_MODULESTORE,
)
from courseware.tests.test_submitting_problems import TestSubmittingProblems
from lms.djangoapps.lms_xblock.runtime import quote_slashes
......
......@@ -8,7 +8,6 @@ from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from courseware.tests.helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from courseware.tests.factories import GlobalStaffFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
......
......@@ -8,12 +8,10 @@ import StringIO
from ddt import ddt, data
from copy import deepcopy
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, mixed_store_config
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from courseware.tests.helpers import LoginEnrollmentTestCase
from courseware.tests.factories import GlobalStaffFactory
......
......@@ -2,10 +2,8 @@
Test for split test XModule
"""
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from mock import MagicMock
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from courseware.module_render import get_module_for_descriptor
from courseware.model_data import FieldDataCache
from student.tests.factories import UserFactory, CourseEnrollmentFactory
......
......@@ -10,7 +10,6 @@ from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from django.test.utils import override_settings
from mock import patch
from capa.tests.response_xml_factory import (
......@@ -20,7 +19,6 @@ from capa.tests.response_xml_factory import (
from courseware import grades
from courseware.models import StudentModule
from courseware.tests.helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from lms.djangoapps.lms_xblock.runtime import quote_slashes
from student.tests.factories import UserFactory
from student.models import anonymous_id_for_user
......
......@@ -16,9 +16,7 @@ course, section, subsection, unit, etc.
"""
from xmodule.video_module import VideoDescriptor
from xmodule.tests import get_test_system, LogicTest, get_test_descriptor_system
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.tests import LogicTest
SOURCE_XML = """
......
......@@ -2,12 +2,10 @@ import datetime
import pytz
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from mock import patch
from courseware.access import has_access
from courseware.tests.helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from courseware.tests.factories import (
BetaTesterFactory,
StaffFactory,
......
......@@ -9,7 +9,7 @@ import unittest
import ddt
from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.auth.models import AnonymousUser
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseBadRequest
from django.test import TestCase
......@@ -24,9 +24,8 @@ from mock import MagicMock, patch, create_autospec, Mock
from opaque_keys.edx.locations import Location, SlashSeparatedCourseKey
import courseware.views as views
from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MOCK_MODULESTORE, TEST_DATA_MIXED_TOY_MODULESTORE
)
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
from course_modes.models import CourseMode
import shoppingcart
from student.models import CourseEnrollment
......
......@@ -5,7 +5,6 @@ from textwrap import dedent
from unittest import TestCase
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
import mock
from opaque_keys.edx.locations import SlashSeparatedCourseKey
......
......@@ -28,7 +28,6 @@ from edxmako.shortcuts import render_to_response, render_to_string, marketing_li
from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.cache import cache_control
from django.db import transaction
from functools import wraps
from markupsafe import escape
from courseware import grades
......
......@@ -14,7 +14,6 @@ from django.core.management.base import CommandError
from django.test.utils import override_settings
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
import dashboard.git_import as git_import
from dashboard.git_import import GitImportError
from xmodule.modulestore import ModuleStoreEnum
......
......@@ -5,9 +5,7 @@ import datetime
from django.contrib.auth.models import Permission
from django.test.client import Client
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from course_modes.models import CourseMode
from shoppingcart.models import CertificateItem, Order
from student.models import CourseEnrollment
......
......@@ -19,9 +19,8 @@ from django.utils.translation import ugettext as _
import mongoengine
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MOCK_MODULESTORE, TEST_DATA_XML_MODULESTORE
)
from xmodule.modulestore.tests.django_utils import TEST_DATA_XML_MODULESTORE
from dashboard.models import CourseImportLog
from dashboard.sysadmin import Users
from dashboard.git_import import GitImportError
......
......@@ -23,7 +23,6 @@ from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase,
TEST_DATA_MOCK_MODULESTORE,
TEST_DATA_MONGO_MODULESTORE
)
from xmodule.modulestore.tests.factories import check_mongo_calls, CourseFactory, ItemFactory
......
......@@ -2,7 +2,6 @@
Tests for the django comment client integration models
"""
from django.test.testcases import TestCase
from django.test.utils import override_settings
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
......
......@@ -11,7 +11,6 @@ from edxnotes import helpers
from edxnotes.decorators import edxnotes
from edxnotes.exceptions import EdxNotesParseError, EdxNotesServiceUnavailable
from django.conf import settings
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured
from oauth2_provider.tests.factories import ClientFactory
......
......@@ -5,7 +5,6 @@ for use by batch processes
"""
from instructor.offline_gradecalc import offline_grade_calculation
from courseware.courses import get_course_by_id
from xmodule.modulestore.django import modulestore
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import SlashSeparatedCourseKey
......
......@@ -10,7 +10,6 @@ from courseware.courses import get_course_by_id
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.django import modulestore
from django.core.management.base import BaseCommand
from instructor.utils import DummyRequest
......
......@@ -6,7 +6,6 @@ from mock import patch
from pytz import UTC
from django.conf import settings
from django.test.utils import override_settings
from opaque_keys.edx.locations import Location
import capa.xqueue_interface as xqueue_interface
......@@ -14,7 +13,6 @@ from courseware.courses import get_course_with_access
from courseware.tests.factories import StudentModuleFactory, UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from xmodule.modulestore.xml_importer import import_course_from_xml
from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild
from xmodule.tests.test_util_open_ended import (
......
......@@ -7,8 +7,6 @@ from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from student.roles import CourseBetaTesterRole, CourseStaffRole
from django_comment_common.models import (Role,
......
......@@ -2,16 +2,16 @@
Unit tests for Ecommerce feature flag in new instructor dashboard.
"""
from django.core.urlresolvers import reverse
import datetime
import pytz
from django.test.utils import override_settings
from mock import patch
import pytz
from django.core.urlresolvers import reverse
from course_modes.models import CourseMode
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from student.roles import CourseFinanceAdminRole
from shoppingcart.models import Coupon, PaidCourseRegistration, CourseRegistrationCode
from shoppingcart.models import Coupon, CourseRegistrationCode
from student.tests.factories import AdminFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
......
......@@ -6,7 +6,6 @@ that the view is conditionally available when Course Auth is turned on.
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from mock import patch
from opaque_keys.edx.locations import SlashSeparatedCourseKey
......
......@@ -9,12 +9,10 @@ from abc import ABCMeta
from courseware.models import StudentModule
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.translation import get_language
from django.utils.translation import override as override_language
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from student.models import CourseEnrollment, CourseEnrollmentAllowed
from instructor.enrollment import (
......
import json
from django.test.client import Client, RequestFactory
from django.test.utils import override_settings
from mock import patch, MagicMock
from courseware.models import XModuleUserStateSummaryField
from courseware.tests.factories import UserStateSummaryFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
import instructor.hint_manager as view
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
......@@ -6,11 +6,9 @@ Unit tests for enrollment methods in views.py
import ddt
from mock import patch
from django.test.utils import override_settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from courseware.tests.helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from xmodule.modulestore.tests.factories import CourseFactory
from student.tests.factories import UserFactory, CourseEnrollmentFactory, AdminFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
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