Move lms.lib.xblock into lms.djangoapps.lms_xblock in preparation add database backed configuration to it
This commit is contained in:
@@ -22,7 +22,7 @@ from xblock.django.request import webob_to_django_response, django_to_webob_requ
|
||||
from xblock.exceptions import NoSuchHandlerError
|
||||
from xblock.fragment import Fragment
|
||||
|
||||
from lms.lib.xblock.field_data import LmsFieldData
|
||||
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
|
||||
from cms.lib.xblock.field_data import CmsFieldData
|
||||
from cms.lib.xblock.runtime import local_resource_url
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ from lms.envs.common import (
|
||||
from path import path
|
||||
from warnings import simplefilter
|
||||
|
||||
from lms.lib.xblock.mixin import LmsBlockMixin
|
||||
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
|
||||
from dealer.git import git
|
||||
from xmodule.modulestore.edit_info import EditInfoMixin
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ 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 lms.lib.xblock.field_data import LmsFieldData
|
||||
from lms.lib.xblock.runtime import LmsModuleSystem, unquote_slashes, quote_slashes
|
||||
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
|
||||
from lms.djangoapps.lms_xblock.runtime import LmsModuleSystem, unquote_slashes, quote_slashes
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from eventtracking import tracker
|
||||
from psychometrics.psychoanalyze import make_psychometrics_data_update_handler
|
||||
|
||||
@@ -20,8 +20,8 @@ from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from lms.lib.xblock.field_data import LmsFieldData
|
||||
from lms.lib.xblock.runtime import quote_slashes
|
||||
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
|
||||
from lms.djangoapps.lms_xblock.runtime import quote_slashes
|
||||
|
||||
|
||||
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
|
||||
|
||||
@@ -13,7 +13,7 @@ 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.lib.xblock.runtime import quote_slashes
|
||||
from lms.djangoapps.lms_xblock.runtime import quote_slashes
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.x_module import STUDENT_VIEW
|
||||
|
||||
@@ -15,7 +15,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
|
||||
from courseware.tests.factories import StaffFactory
|
||||
from courseware.tests.helpers import LoginEnrollmentTestCase
|
||||
from lms.lib.xblock.runtime import quote_slashes
|
||||
from lms.djangoapps.lms_xblock.runtime import quote_slashes
|
||||
from xmodule.modulestore.django import modulestore, clear_existing_modulestores
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_GRADED_MODULESTORE
|
||||
|
||||
@@ -30,9 +30,10 @@ from xmodule.modulestore.tests.django_utils import (
|
||||
TEST_DATA_XML_MODULESTORE
|
||||
)
|
||||
from courseware.tests.test_submitting_problems import TestSubmittingProblems
|
||||
from lms.lib.xblock.runtime import quote_slashes
|
||||
from lms.djangoapps.lms_xblock.runtime import quote_slashes
|
||||
from student.models import anonymous_id_for_user
|
||||
from xmodule.lti_module import LTIDescriptor
|
||||
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
|
||||
@@ -21,7 +21,7 @@ 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.lib.xblock.runtime import quote_slashes
|
||||
from lms.djangoapps.lms_xblock.runtime import quote_slashes
|
||||
from student.tests.factories import UserFactory
|
||||
from student.models import anonymous_id_for_user
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
|
||||
@@ -12,7 +12,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from courseware.tests.helpers import LoginEnrollmentTestCase
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_XML_MODULESTORE as XML_MODULESTORE
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE as TOY_MODULESTORE
|
||||
from lms.lib.xblock.field_data import LmsFieldData
|
||||
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
|
||||
from xmodule.error_module import ErrorDescriptor
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
|
||||
@@ -19,7 +19,7 @@ from django.http import Http404
|
||||
from django.conf import settings
|
||||
from util.json_request import JsonResponse
|
||||
|
||||
from lms.lib.xblock.runtime import quote_slashes
|
||||
from lms.djangoapps.lms_xblock.runtime import quote_slashes
|
||||
from xmodule_modifiers import wrap_xblock
|
||||
from xmodule.html_module import HtmlDescriptor
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
@@ -32,7 +32,7 @@ from instructor_task.tasks_helper import upload_grades_csv
|
||||
from instructor_task.tests.test_base import (InstructorTaskModuleTestCase, TestReportMixin, TEST_COURSE_ORG,
|
||||
TEST_COURSE_NUMBER, OPTION_1, OPTION_2)
|
||||
from capa.responsetypes import StudentInputError
|
||||
from lms.lib.xblock.runtime import quote_slashes
|
||||
from lms.djangoapps.lms_xblock.runtime import quote_slashes
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
0
lms/djangoapps/lms_xblock/test/__init__.py
Normal file
0
lms/djangoapps/lms_xblock/test/__init__.py
Normal file
@@ -9,7 +9,7 @@ from mock import Mock
|
||||
from unittest import TestCase
|
||||
from urlparse import urlparse
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from lms.lib.xblock.runtime import quote_slashes, unquote_slashes, LmsModuleSystem
|
||||
from lms.djangoapps.lms_xblock.runtime import quote_slashes, unquote_slashes, LmsModuleSystem
|
||||
|
||||
TEST_STRINGS = [
|
||||
'',
|
||||
@@ -2,6 +2,8 @@
|
||||
Unit tests for the notes app.
|
||||
"""
|
||||
|
||||
from mock import patch, Mock
|
||||
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from django.test import TestCase
|
||||
from django.test.client import Client
|
||||
@@ -12,7 +14,7 @@ from django.core.exceptions import ValidationError
|
||||
import collections
|
||||
import json
|
||||
|
||||
from . import utils, api, models
|
||||
from notes import utils, api, models
|
||||
|
||||
|
||||
class UtilsTest(TestCase):
|
||||
@@ -49,7 +51,9 @@ class ApiTest(TestCase):
|
||||
self.client = Client()
|
||||
|
||||
# Mocks
|
||||
api.api_enabled = self.mock_api_enabled(True)
|
||||
patcher = patch.object(api, 'api_enabled', Mock(return_value=True))
|
||||
patcher.start()
|
||||
self.addCleanup(patcher.stop)
|
||||
|
||||
# Create two accounts
|
||||
self.password = 'abc'
|
||||
@@ -73,9 +77,6 @@ class ApiTest(TestCase):
|
||||
# Make sure no note with this ID ever exists for testing purposes
|
||||
self.NOTE_ID_DOES_NOT_EXIST = 99999
|
||||
|
||||
def mock_api_enabled(self, is_enabled):
|
||||
return (lambda request, course_id: is_enabled)
|
||||
|
||||
def login(self, as_student=None):
|
||||
username = None
|
||||
password = self.password
|
||||
|
||||
@@ -10,7 +10,7 @@ from xmodule.open_ended_grading_classes.controller_query_service import Controll
|
||||
from xmodule.modulestore.django import ModuleI18nService
|
||||
|
||||
from courseware.access import has_access
|
||||
from lms.lib.xblock.runtime import LmsModuleSystem
|
||||
from lms.djangoapps.lms_xblock.runtime import LmsModuleSystem
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from student.models import unique_id_for_user
|
||||
from util.cache import cache
|
||||
|
||||
@@ -14,7 +14,7 @@ from xmodule.open_ended_grading_classes.grading_service_module import GradingSer
|
||||
from xmodule.modulestore.django import ModuleI18nService
|
||||
|
||||
from courseware.access import has_access
|
||||
from lms.lib.xblock.runtime import LmsModuleSystem
|
||||
from lms.djangoapps.lms_xblock.runtime import LmsModuleSystem
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from student.models import unique_id_for_user
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from xmodule.open_ended_grading_classes.grading_service_module import GradingSer
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.conf import settings
|
||||
|
||||
from lms.lib.xblock.runtime import LmsModuleSystem
|
||||
from lms.djangoapps.lms_xblock.runtime import LmsModuleSystem
|
||||
from edxmako.shortcuts import render_to_string
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .discussionsettings import *
|
||||
from xmodule.modulestore.modulestore_settings import update_module_store_settings
|
||||
from lms.lib.xblock.mixin import LmsBlockMixin
|
||||
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
|
||||
|
||||
################################### FEATURES ###################################
|
||||
# The display name of the platform to be used in templates/emails/etc.
|
||||
|
||||
@@ -34,8 +34,8 @@ def find_fixme(options):
|
||||
apps_list = ' '.join(apps)
|
||||
|
||||
pythonpath_prefix = (
|
||||
"PYTHONPATH={system}:{system}/djangoapps:{system}/"
|
||||
"lib:common/djangoapps:common/lib".format(
|
||||
"PYTHONPATH={system}:{system}/lib"
|
||||
"common/djangoapps:common/lib".format(
|
||||
system=system
|
||||
)
|
||||
)
|
||||
@@ -83,7 +83,7 @@ def run_pylint(options):
|
||||
|
||||
apps = [system]
|
||||
|
||||
for directory in ['djangoapps', 'lib']:
|
||||
for directory in ['lib']:
|
||||
dirs = os.listdir(os.path.join(system, directory))
|
||||
apps.extend([d for d in dirs if os.path.isdir(os.path.join(system, directory, d))])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user