diff --git a/lms/djangoapps/course_api/blocks/tests/test_api.py b/lms/djangoapps/course_api/blocks/tests/test_api.py index 787cc57140..f4e3d8688d 100644 --- a/lms/djangoapps/course_api/blocks/tests/test_api.py +++ b/lms/djangoapps/course_api/blocks/tests/test_api.py @@ -4,7 +4,6 @@ Tests for Blocks api.py from django.test.client import RequestFactory -from openedx.core.djangoapps.content.block_structure.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase @@ -13,7 +12,7 @@ from xmodule.modulestore.tests.factories import SampleCourseFactory from ..api import get_blocks -class TestGetBlocks(EnableTransformerRegistryMixin, SharedModuleStoreTestCase): +class TestGetBlocks(SharedModuleStoreTestCase): """ Tests for the get_blocks function """ diff --git a/lms/djangoapps/course_api/blocks/tests/test_forms.py b/lms/djangoapps/course_api/blocks/tests/test_forms.py index b8fe2f00db..ac0bc93ac6 100644 --- a/lms/djangoapps/course_api/blocks/tests/test_forms.py +++ b/lms/djangoapps/course_api/blocks/tests/test_forms.py @@ -7,7 +7,6 @@ from urllib import urlencode from rest_framework.exceptions import PermissionDenied from opaque_keys.edx.locator import CourseLocator -from openedx.core.djangoapps.content.block_structure.tests.helpers import EnableTransformerRegistryMixin from openedx.core.djangoapps.util.test_forms import FormTestMixin from student.models import CourseEnrollment from student.tests.factories import UserFactory, CourseEnrollmentFactory @@ -18,7 +17,7 @@ from ..forms import BlockListGetForm @ddt.ddt -class TestBlockListGetForm(EnableTransformerRegistryMixin, FormTestMixin, SharedModuleStoreTestCase): +class TestBlockListGetForm(FormTestMixin, SharedModuleStoreTestCase): """ Tests for BlockListGetForm """ diff --git a/lms/djangoapps/course_api/blocks/tests/test_serializers.py b/lms/djangoapps/course_api/blocks/tests/test_serializers.py index ffa8949f45..565d19c458 100644 --- a/lms/djangoapps/course_api/blocks/tests/test_serializers.py +++ b/lms/djangoapps/course_api/blocks/tests/test_serializers.py @@ -3,7 +3,6 @@ Tests for Course Blocks serializers """ from mock import MagicMock -from openedx.core.djangoapps.content.block_structure.tests.helpers import EnableTransformerRegistryMixin from openedx.core.lib.block_structure.transformers import BlockStructureTransformers from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum @@ -17,7 +16,7 @@ from ..serializers import BlockSerializer, BlockDictSerializer from .helpers import deserialize_usage_key -class TestBlockSerializerBase(EnableTransformerRegistryMixin, SharedModuleStoreTestCase): +class TestBlockSerializerBase(SharedModuleStoreTestCase): """ Base class for testing BlockSerializer and BlockDictSerializer """ diff --git a/lms/djangoapps/course_api/blocks/tests/test_views.py b/lms/djangoapps/course_api/blocks/tests/test_views.py index 3355016464..19d8c05727 100644 --- a/lms/djangoapps/course_api/blocks/tests/test_views.py +++ b/lms/djangoapps/course_api/blocks/tests/test_views.py @@ -8,7 +8,6 @@ from urllib import urlencode from urlparse import urlunparse from opaque_keys.edx.locator import CourseLocator -from openedx.core.djangoapps.content.block_structure.tests.helpers import EnableTransformerRegistryMixin from student.models import CourseEnrollment from student.tests.factories import AdminFactory, CourseEnrollmentFactory, UserFactory from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase @@ -17,7 +16,7 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory from .helpers import deserialize_usage_key -class TestBlocksView(EnableTransformerRegistryMixin, SharedModuleStoreTestCase): +class TestBlocksView(SharedModuleStoreTestCase): """ Test class for BlocksView """ diff --git a/lms/djangoapps/courseware/tests/test_discussion_module.py b/lms/djangoapps/courseware/tests/test_discussion_module.py index 4802ec89bd..e4ae915992 100644 --- a/lms/djangoapps/courseware/tests/test_discussion_module.py +++ b/lms/djangoapps/courseware/tests/test_discussion_module.py @@ -6,7 +6,6 @@ from mock import Mock from . import BaseTestXmodule from course_api.blocks.tests.helpers import deserialize_usage_key from courseware.module_render import get_module_for_descriptor_internal -from openedx.core.djangoapps.content.block_structure.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory, CourseEnrollmentFactory from xmodule.discussion_module import DiscussionModule from xmodule.modulestore import ModuleStoreEnum @@ -16,7 +15,7 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory, ItemFactory @ddt.ddt -class DiscussionModuleTest(BaseTestXmodule, EnableTransformerRegistryMixin, SharedModuleStoreTestCase): +class DiscussionModuleTest(BaseTestXmodule, SharedModuleStoreTestCase): """Logic tests for Discussion Xmodule.""" CATEGORY = "discussion" diff --git a/lms/envs/test.py b/lms/envs/test.py index e148d74f02..d000668a12 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -577,11 +577,6 @@ JWT_AUTH.update({ 'JWT_AUDIENCE': 'test-key', }) -# Disable the use of the plugin manager in the transformer registry for -# better performant unit tests. -from openedx.core.lib.block_structure.transformer_registry import TransformerRegistry -TransformerRegistry.USE_PLUGIN_MANAGER = False - # Set the default Oauth2 Provider Model so that migrations can run in # verbose mode OAUTH2_PROVIDER_APPLICATION_MODEL = 'oauth2_provider.Application' diff --git a/openedx/core/djangoapps/content/block_structure/tests/helpers.py b/openedx/core/djangoapps/content/block_structure/tests/helpers.py index 34b6f4f809..6ec3137028 100644 --- a/openedx/core/djangoapps/content/block_structure/tests/helpers.py +++ b/openedx/core/djangoapps/content/block_structure/tests/helpers.py @@ -3,28 +3,9 @@ Helpers for Course Blocks tests. """ from openedx.core.lib.block_structure.cache import BlockStructureCache -from openedx.core.lib.block_structure.transformer_registry import TransformerRegistry from ..api import get_cache -class EnableTransformerRegistryMixin(object): - """ - Mixin that enables the TransformerRegistry to USE_PLUGIN_MANAGER for - finding registered transformers. USE_PLUGIN_MANAGER is set to False - for LMS unit tests to speed up performance of the unit tests, so all - registered transformers in the platform do not need to be collected. - This Mixin is expected to be used by Tests for integration testing - with all registered transformers. - """ - def setUp(self, **kwargs): - super(EnableTransformerRegistryMixin, self).setUp(**kwargs) - TransformerRegistry.USE_PLUGIN_MANAGER = True - - def tearDown(self): - super(EnableTransformerRegistryMixin, self).tearDown() - TransformerRegistry.USE_PLUGIN_MANAGER = False - - def is_course_in_block_structure_cache(course_key, store): """ Returns whether the given course is in the Block Structure cache. diff --git a/openedx/core/djangoapps/content/block_structure/tests/test_signals.py b/openedx/core/djangoapps/content/block_structure/tests/test_signals.py index b9003ef331..ebb1225e7d 100644 --- a/openedx/core/djangoapps/content/block_structure/tests/test_signals.py +++ b/openedx/core/djangoapps/content/block_structure/tests/test_signals.py @@ -7,10 +7,10 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from ..api import get_block_structure_manager -from .helpers import is_course_in_block_structure_cache, EnableTransformerRegistryMixin +from .helpers import is_course_in_block_structure_cache -class CourseBlocksSignalTest(EnableTransformerRegistryMixin, ModuleStoreTestCase): +class CourseBlocksSignalTest(ModuleStoreTestCase): """ Tests for the Course Blocks signal """