diff --git a/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py b/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py index 594c7b0f02..3ed0ae09c0 100644 --- a/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py +++ b/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py @@ -3,9 +3,7 @@ Tests for Blockstore-based Content Libraries """ from uuid import UUID from unittest.mock import patch -from urllib.parse import urlparse, parse_qsl -import json import ddt from django.conf import settings from django.contrib.auth.models import Group @@ -13,9 +11,6 @@ from django.test.client import Client from django.test.utils import override_settings from organizations.models import Organization from rest_framework.test import APITestCase -from web_fragments.fragment import Fragment -from webob import Response -from xblock.core import XBlock from openedx.core.djangoapps.content_libraries.libraries_index import LibraryBlockIndexer, ContentLibraryIndexer from openedx.core.djangoapps.content_libraries.tests.base import ( @@ -26,7 +21,6 @@ from openedx.core.djangoapps.content_libraries.tests.base import ( URL_BLOCK_RENDER_VIEW, URL_BLOCK_GET_HANDLER_URL, URL_BLOCK_XBLOCK_HANDLER, - URL_LIB_BLOCK_OLX, ) from openedx.core.djangoapps.content_libraries.constants import VIDEO, COMPLEX, PROBLEM, CC_4_BY, ALL_RIGHTS_RESERVED from openedx.core.djangolib.blockstore_cache import cache @@ -999,183 +993,3 @@ class ContentLibraryXBlockValidationTest(APITestCase): self.assertEqual(response.json(), { 'detail': f"XBlock {valid_not_found_key} does not exist, or you don't have permission to view it.", }) - - -class AltBlock(XBlock): - """Class for testing LabXchange XBlock type overrides.""" - @XBlock.handler - def student_view_user_state(self, request, suffix=""): - """ - Returns a JSON response for testing. - """ - view_state = { - "id": str(self.location), - "block_type": str(self.location.block_type), - "override_type": str(self.__class__), - } - return Response( - json.dumps(view_state), - content_type='application/json', - charset='UTF-8', - ) - - def student_view(self, context=None): - """ - Returns an HTML fragment for testing. - """ - return Fragment(f"
" - "
") - - -@ddt.ddt -class ContentLibrariesXBlockTypeOverrideTestMixin: - """ - Tests for Blockstore-based Content Libraries XBlock API, - where the expected XBlock type returned is overridden in the request. - """ - BLOCK_DATA = ( - ('block-wo-override', {}, 'video'), - ('block-w-override', {'lx_block_types': '1'}, 'alt-block'), - ) - - def setUp(self): - super().setUp() - if settings.ENABLE_ELASTICSEARCH_FOR_TESTS: - ContentLibraryIndexer.remove_all_items() - LibraryBlockIndexer.remove_all_items() - - self.olx = """ -