Revert "Merge pull request #15170 from edx/jeskew/PLAT_1316_partitions_inheritance"

This reverts commit f97f052591, reversing
changes made to 800bcd8e20.
This commit is contained in:
John Eskew
2017-05-30 11:38:03 -04:00
parent d71a1d8887
commit 3b57542ab0
94 changed files with 1111 additions and 1086 deletions

View File

@@ -4,12 +4,13 @@ Class for manipulating groups configuration on a course object.
import json
import logging
from contentstore.utils import reverse_usage_url
from util.db import generate_int_id, MYSQL_MAX_INT
from django.utils.translation import ugettext as _
from contentstore.utils import reverse_usage_url
from openedx.core.djangoapps.course_groups.partition_scheme import get_cohorted_user_partition
from openedx.core.lib.partitions.partitions import MINIMUM_STATIC_PARTITION_ID, UserPartition
from openedx.core.lib.partitions.partitions_service import get_all_partitions_for_course
from util.db import MYSQL_MAX_INT, generate_int_id
from xmodule.partitions.partitions import UserPartition, MINIMUM_STATIC_PARTITION_ID
from xmodule.partitions.partitions_service import get_all_partitions_for_course
from xmodule.split_test_module import get_split_user_partitions
MINIMUM_GROUP_ID = MINIMUM_STATIC_PARTITION_ID

View File

@@ -1,34 +1,35 @@
"""
Tests for Studio Course Settings.
"""
import copy
import datetime
import ddt
import json
import copy
import mock
from mock import Mock, patch
import unittest
import ddt
import mock
from contentstore.utils import reverse_course_url, reverse_usage_url
from django.conf import settings
from django.test.utils import override_settings
from django.utils.timezone import UTC
from milestones.tests.utils import MilestonesTestCaseMixin
from mock import Mock, patch
from django.test.utils import override_settings
from contentstore.utils import reverse_course_url, reverse_usage_url
from models.settings.course_grading import CourseGradingModel
from models.settings.course_metadata import CourseMetadata
from models.settings.encoder import CourseSettingsEncoder
from openedx.core.djangoapps.models.course_details import CourseDetails
from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
from openedx.core.lib.xblock_fields.fields import Date
from openedx.core.djangoapps.models.course_details import CourseDetails
from student.roles import CourseInstructorRole, CourseStaffRole
from student.tests.factories import UserFactory
from xblock_django.models import XBlockStudioConfigurationFlag
from xmodule.fields import Date
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.tabs import InvalidTabsException
from milestones.tests.utils import MilestonesTestCaseMixin
from .utils import AjaxEnabledTestClient, CourseTestCase
from .utils import CourseTestCase, AjaxEnabledTestClient
def get_url(course_id, handler_name='settings_handler'):

View File

@@ -1,52 +1,52 @@
"""
Testing indexing of the courseware as it is changed
"""
import ddt
import json
from lazy.lazy import lazy
import time
from datetime import datetime
from unittest import skip
from uuid import uuid4
import ddt
from contentstore.courseware_index import (
CourseAboutSearchIndexer,
CoursewareSearchIndexer,
LibrarySearchIndexer,
SearchIndexingError
)
from contentstore.signals.handlers import listen_for_course_publish, listen_for_library_update
from contentstore.tests.utils import CourseTestCase
from contentstore.utils import reverse_course_url, reverse_usage_url
from course_modes.models import CourseMode
from dateutil.tz import tzutc
from django.conf import settings
from lazy.lazy import lazy
from mock import patch
from openedx.core.djangoapps.models.course_details import CourseDetails
from openedx.core.lib.partitions.partitions import UserPartition
from openedx.core.lib.xblock_fields.inherited_fields import InheritanceMixin
from pytz import UTC
from search.search_engine_base import SearchEngine
from uuid import uuid4
from unittest import skip
from django.conf import settings
from course_modes.models import CourseMode
from openedx.core.djangoapps.models.course_details import CourseDetails
from xmodule.library_tools import normalize_key_for_search
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import SignalHandler, modulestore
from xmodule.modulestore.edit_info import EditInfoMixin
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore.mixed import MixedModuleStore
from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MONGO_MODULESTORE,
TEST_DATA_SPLIT_MODULESTORE,
SharedModuleStoreTestCase
)
SharedModuleStoreTestCase)
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, LibraryFactory
from xmodule.modulestore.tests.mongo_connection import MONGO_HOST, MONGO_PORT_NUM
from xmodule.modulestore.tests.mongo_connection import MONGO_PORT_NUM, MONGO_HOST
from xmodule.modulestore.tests.utils import (
LocationMixin,
MixedSplitTestCase,
MongoContentstoreBuilder,
create_modulestore_instance
create_modulestore_instance, LocationMixin,
MixedSplitTestCase, MongoContentstoreBuilder
)
from xmodule.tests import DATA_DIR
from xmodule.x_module import XModuleMixin
from xmodule.partitions.partitions import UserPartition
from search.search_engine_base import SearchEngine
from contentstore.courseware_index import (
CoursewareSearchIndexer,
LibrarySearchIndexer,
SearchIndexingError,
CourseAboutSearchIndexer,
)
from contentstore.signals.handlers import listen_for_course_publish, listen_for_library_update
from contentstore.utils import reverse_course_url, reverse_usage_url
from contentstore.tests.utils import CourseTestCase
COURSE_CHILD_STRUCTURE = {
"course": "chapter",

View File

@@ -2,17 +2,19 @@
import collections
from datetime import datetime, timedelta
from pytz import UTC
from django.test import TestCase
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.django import modulestore
from xmodule.partitions.partitions import UserPartition, Group
from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration_context
from contentstore import utils
from contentstore.tests.utils import CourseTestCase
from django.test import TestCase
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration_context
from openedx.core.lib.partitions.partitions import Group, UserPartition
from pytz import UTC
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
class LMSLinksTestCase(TestCase):

View File

@@ -4,23 +4,26 @@ Common utility functions useful throughout the contentstore
import logging
from datetime import datetime
from pytz import UTC
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django_comment_common.models import assign_default_role
from django_comment_common.utils import seed_permissions_roles
from opaque_keys.edx.keys import CourseKey, UsageKey
from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
from openedx.core.lib.partitions.partitions_service import get_all_partitions_for_course
from pytz import UTC
from student import auth
from student.models import CourseEnrollment
from student.roles import CourseInstructorRole, CourseStaffRole
from xmodule.partitions.partitions_service import get_all_partitions_for_course
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
from opaque_keys.edx.keys import UsageKey, CourseKey
from student.roles import CourseInstructorRole, CourseStaffRole
from student.models import CourseEnrollment
from student import auth
log = logging.getLogger(__name__)

View File

@@ -70,7 +70,6 @@ from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.lib.course_tabs import CourseTabPluginManager
from openedx.core.lib.courses import course_image_url
from openedx.core.lib.xblock_fields.inherited_fields import DEFAULT_START_DATE
from openedx.core.djangolib.js_utils import dump_js_escaped_json
from student import auth
from student.auth import has_course_author_access, has_studio_write_access, has_studio_read_access
@@ -95,6 +94,7 @@ from util.string_utils import _has_non_ascii_characters
from xblock_django.api import deprecated_xblocks
from xmodule.contentstore.content import StaticContent
from xmodule.course_module import CourseFields
from xmodule.course_module import DEFAULT_START_DATE
from xmodule.error_module import ErrorDescriptor
from xmodule.modulestore import EdxJSONEncoder
from xmodule.modulestore.django import modulestore

View File

@@ -38,16 +38,16 @@ from contentstore.views.helpers import is_unit, xblock_studio_url, xblock_primar
from contentstore.views.preview import get_preview_fragment
from contentstore.utils import is_self_paced
from openedx.core.lib.gating import api as gating_api
from edxmako.shortcuts import render_to_string
from models.settings.course_grading import CourseGradingModel
from openedx.core.lib.gating import api as gating_api
from openedx.core.lib.xblock_utils import wrap_xblock, request_token
from openedx.core.lib.xblock_fields.inherited_fields import DEFAULT_START_DATE
from static_replace import replace_static_urls
from student.auth import has_studio_write_access, has_studio_read_access
from util.date_utils import get_default_time_display
from util.json_request import expect_json, JsonResponse
from util.milestones_helpers import is_entrance_exams_enabled
from xmodule.course_module import DEFAULT_START_DATE
from xmodule.modulestore import ModuleStoreEnum, EdxJSONEncoder
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.draft_and_published import DIRECT_ONLY_CATEGORIES

View File

@@ -3,45 +3,45 @@ from __future__ import absolute_import
import logging
from functools import partial
import static_replace
from cms.lib.xblock.field_data import CmsFieldData
from contentstore.utils import get_visibility_partition_info
from contentstore.views.access import get_user_role
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from edxmako.shortcuts import render_to_string
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
from opaque_keys.edx.keys import UsageKey
from openedx.core.lib.license import wrap_with_license
from openedx.core.lib.partitions.partitions_service import PartitionService
from openedx.core.lib.xblock_utils import (
replace_static_urls,
request_token,
wrap_fragment,
wrap_xblock,
wrap_xblock_aside,
xblock_local_resource_url
replace_static_urls, wrap_xblock, wrap_fragment, wrap_xblock_aside, request_token, xblock_local_resource_url,
)
from util.sandboxing import can_execute_unsafe_code, get_python_lib_zip
from xblock.django.request import django_to_webob_request, webob_to_django_response
from xblock.exceptions import NoSuchHandlerError
from xblock.fragment import Fragment
from xblock.runtime import KvsFieldData
from xblock_config.models import StudioConfig
from xblock_django.user_service import DjangoXBlockUserService
from xmodule.x_module import PREVIEW_VIEWS, STUDENT_VIEW, AUTHOR_VIEW
from xmodule.contentstore.django import contentstore
from xmodule.error_module import ErrorDescriptor
from xmodule.exceptions import NotFoundError, ProcessingError
from xmodule.modulestore.django import ModuleI18nService, modulestore
from xmodule.services import SettingsService
from xmodule.partitions.partitions_service import PartitionService
from xmodule.studio_editable import has_author_view
from xmodule.x_module import AUTHOR_VIEW, PREVIEW_VIEWS, STUDENT_VIEW, ModuleSystem
from xmodule.services import SettingsService
from xmodule.modulestore.django import modulestore, ModuleI18nService
from openedx.core.lib.license import wrap_with_license
from opaque_keys.edx.keys import UsageKey
from xmodule.x_module import ModuleSystem
from xblock.runtime import KvsFieldData
from xblock.django.request import webob_to_django_response, django_to_webob_request
from xblock.exceptions import NoSuchHandlerError
from xblock.fragment import Fragment
from xblock_django.user_service import DjangoXBlockUserService
from .helpers import render_from_lms
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
from cms.lib.xblock.field_data import CmsFieldData
from util.sandboxing import can_execute_unsafe_code, get_python_lib_zip
import static_replace
from .session_kv_store import SessionKeyValueStore
from .helpers import render_from_lms
from contentstore.utils import get_visibility_partition_info
from contentstore.views.access import get_user_role
from xblock_config.models import StudioConfig
__all__ = ['preview_handler']

View File

@@ -4,17 +4,17 @@
Group Configuration Tests.
"""
import json
import ddt
from contentstore.course_group_config import CONTENT_GROUP_CONFIGURATION_NAME, GroupConfiguration
from contentstore.tests.utils import CourseTestCase
from contentstore.utils import reverse_course_url, reverse_usage_url
from mock import patch
from openedx.core.lib.partitions.partitions import Group, UserPartition
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from contentstore.utils import reverse_course_url, reverse_usage_url
from contentstore.course_group_config import GroupConfiguration, CONTENT_GROUP_CONFIGURATION_NAME
from contentstore.tests.utils import CourseTestCase
from xmodule.partitions.partitions import Group, UserPartition
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.validation import StudioValidation, StudioValidationMessage
from xmodule.modulestore.django import modulestore
from xmodule.modulestore import ModuleStoreEnum
GROUP_CONFIGURATION_JSON = {
u'name': u'Test name',

View File

@@ -1,56 +1,53 @@
"""Tests for items views."""
import json
from datetime import datetime, timedelta
import ddt
from contentstore.tests.utils import CourseTestCase
from contentstore.utils import reverse_course_url, reverse_usage_url
from contentstore.views.component import component_handler, get_component_templates
from contentstore.views.item import (
ALWAYS,
VisibilityState,
_get_module_info,
_get_source_index,
_xblock_type_and_display_name,
add_container_page_publishing_info,
create_xblock_info
)
from mock import patch, Mock, PropertyMock
from pytz import UTC
from pyquery import PyQuery
from webob import Response
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory
from mock import Mock, PropertyMock, patch
from django.core.urlresolvers import reverse
from contentstore.utils import reverse_usage_url, reverse_course_url
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey, UsageKey
from opaque_keys.edx.locations import Location
from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
from openedx.core.lib.partitions.partitions import (
ENROLLMENT_TRACK_PARTITION_ID,
MINIMUM_STATIC_PARTITION_ID,
Group,
UserPartition
from contentstore.views.component import (
component_handler, get_component_templates
)
from openedx.core.lib.xblock_fields.inherited_fields import DEFAULT_START_DATE
from pyquery import PyQuery
from pytz import UTC
from contentstore.views.item import (
create_xblock_info, _get_source_index, _get_module_info, ALWAYS, VisibilityState, _xblock_type_and_display_name,
add_container_page_publishing_info
)
from contentstore.tests.utils import CourseTestCase
from student.tests.factories import UserFactory
from webob import Response
from xblock.core import XBlockAside
from xblock.exceptions import NoSuchHandlerError
from xblock.fields import Scope, ScopeIds, String
from xblock.fragment import Fragment
from xblock.runtime import DictKeyValueStore, KvsFieldData
from xblock.test.tools import TestRuntime
from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConfigurationFlag
from xblock_django.user_service import DjangoXBlockUserService
from xmodule.capa_module import CapaDescriptor
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, LibraryFactory, check_mongo_calls
from xmodule.x_module import STUDENT_VIEW, STUDIO_VIEW
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE
from xmodule.modulestore.tests.factories import ItemFactory, LibraryFactory, check_mongo_calls, CourseFactory
from xmodule.x_module import STUDIO_VIEW, STUDENT_VIEW
from xmodule.course_module import DEFAULT_START_DATE
from xblock.core import XBlockAside
from xblock.fields import Scope, String, ScopeIds
from xblock.fragment import Fragment
from xblock.runtime import DictKeyValueStore, KvsFieldData
from xblock.test.tools import TestRuntime
from xblock.exceptions import NoSuchHandlerError
from xblock_django.user_service import DjangoXBlockUserService
from opaque_keys.edx.keys import UsageKey, CourseKey
from opaque_keys.edx.locations import Location
from xmodule.partitions.partitions import (
Group, UserPartition, ENROLLMENT_TRACK_PARTITION_ID, MINIMUM_STATIC_PARTITION_ID
)
class AsideTest(XBlockAside):

View File

@@ -7,7 +7,7 @@ from json.encoder import JSONEncoder
from opaque_keys.edx.locations import Location
from openedx.core.djangoapps.models.course_details import CourseDetails
from openedx.core.lib.xblock_fields.fields import Date
from xmodule.fields import Date
from .course_grading import CourseGradingModel

View File

@@ -434,7 +434,7 @@ P3P_HEADER = 'CP="Open EdX does not have a P3P policy."'
############# XBlock Configuration ##########
# Import after sys.path fixup
from openedx.core.lib.xblock_fields.inherited_fields import InheritanceMixin
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore import prefer_xmodules
from xmodule.x_module import XModuleMixin

View File

@@ -1,17 +1,16 @@
"""
Tests for the Studio authoring XBlock mixin.
"""
from course_modes.tests.factories import CourseModeFactory
from django.conf import settings
from django.test.utils import override_settings
from openedx.core.lib.partitions.partitions import (
ENROLLMENT_TRACK_PARTITION_ID,
MINIMUM_STATIC_PARTITION_ID,
Group,
UserPartition
)
from course_modes.tests.factories import CourseModeFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.partitions.partitions import (
Group, UserPartition, ENROLLMENT_TRACK_PARTITION_ID, MINIMUM_STATIC_PARTITION_ID
)
class AuthoringMixinTestCase(ModuleStoreTestCase):