Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lms/djangoapps/courseware/tests/test_block_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
Mixologist, # pylint: disable=wrong-import-order
)
from xblock.test.tools import TestRuntime # pylint: disable=wrong-import-order
from xblocks_contrib.lti import LTIBlock
from xblocks_contrib.problem.capa.tests.response_xml_factory import (
OptionResponseXMLFactory, # pylint: disable=reimported
)
Expand Down Expand Up @@ -97,7 +98,6 @@
from xmodule.capa_block import ProblemBlock
from xmodule.contentstore.django import contentstore
from xmodule.html_block import AboutBlock, CourseInfoBlock, HtmlBlock, StaticTabBlock
from xmodule.lti_block import LTIBlock
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import XBlockI18nService, modulestore
from xmodule.modulestore.tests.django_utils import (
Expand Down
40 changes: 8 additions & 32 deletions lms/djangoapps/courseware/tests/test_lti_integration.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""LTI integration tests"""


import importlib
import json
import re
import urllib
Expand All @@ -11,15 +10,13 @@

import oauthlib
from django.conf import settings
from django.test import override_settings
from django.urls import reverse
from xblock import plugin

from common.djangoapps.xblock_django.constants import ATTR_KEY_ANONYMOUS_USER_ID
from lms.djangoapps.courseware.tests.helpers import BaseTestXmodule
from lms.djangoapps.courseware.views.views import get_course_lti_endpoints
from openedx.core.lib.url_utils import quote_slashes
from xmodule import lti_block
from xmodule.modulestore.tests.django_utils import (
SharedModuleStoreTestCase, # pylint: disable=wrong-import-order
)
Expand All @@ -45,7 +42,6 @@ class _TestLTIBase(BaseTestXmodule):
def setUpClass(cls):
super().setUpClass()
plugin.PLUGIN_CACHE = {}
importlib.reload(lti_block)

def setUp(self):
"""
Expand Down Expand Up @@ -137,25 +133,17 @@ def mocked_sign(self, *args, **kwargs):
@patch('xblock.utils.resources.ResourceLoader.render_django_template', side_effect=mock_render_template)
def test_lti_constructor(self, mock_render_django_template):
generated_content = self.block.student_view(None).content

if settings.USE_EXTRACTED_LTI_BLOCK:
# Remove i18n service from the extracted LTI Block's rendered `student_view` content
generated_content = re.sub(r"\{.*?}", "{}", generated_content)
expected_content = self.runtime.render_template('templates/lti.html', self.expected_context)
mock_render_django_template.assert_called_once()
else:
expected_content = self.runtime.render_template('lti.html', self.expected_context)
# Remove i18n service from the extracted LTI Block's rendered `student_view` content
generated_content = re.sub(r"\{.*?}", "{}", generated_content)
expected_content = self.runtime.render_template('templates/lti.html', self.expected_context)
mock_render_django_template.assert_called_once()
assert generated_content == expected_content

@patch('xblock.utils.resources.ResourceLoader.render_django_template', side_effect=mock_render_template)
def test_lti_preview_handler(self, mock_render_django_template):
generated_content = self.block.preview_handler(None, None).body

if settings.USE_EXTRACTED_LTI_BLOCK:
expected_content = self.runtime.render_template('templates/lti_form.html', self.expected_context)
mock_render_django_template.assert_called_once()
else:
expected_content = self.runtime.render_template('lti_form.html', self.expected_context)
expected_content = self.runtime.render_template('templates/lti_form.html', self.expected_context)
mock_render_django_template.assert_called_once()
assert generated_content.decode('utf-8') == expected_content


Expand Down Expand Up @@ -251,21 +239,9 @@ def test_lti_rest_non_get(self):
assert 405 == response.status_code


@override_settings(USE_EXTRACTED_LTI_BLOCK=True)
class TestLTIExtracted(_TestLTIBase):
__test__ = True


@override_settings(USE_EXTRACTED_LTI_BLOCK=False)
class TestLTIBuiltIn(_TestLTIBase):
__test__ = True


@override_settings(USE_EXTRACTED_LTI_BLOCK=True)
class TestLTIBlockListingExtracted(_TestLTIBlockListingBase):
class TestLTI(_TestLTIBase):
__test__ = True


@override_settings(USE_EXTRACTED_LTI_BLOCK=False)
class TestLTIBlockListingBuiltIn(_TestLTIBlockListingBase):
class TestLTIBlockListing(_TestLTIBlockListingBase):
__test__ = True
69 changes: 0 additions & 69 deletions lms/templates/lti.html

This file was deleted.

40 changes: 0 additions & 40 deletions lms/templates/lti_form.html

This file was deleted.

8 changes: 0 additions & 8 deletions openedx/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2086,14 +2086,6 @@ def add_optional_apps(optional_apps, installed_apps):
# .. toggle_target_removal_date: 2026-04-10
USE_EXTRACTED_POLL_QUESTION_BLOCK = True

# .. toggle_name: USE_EXTRACTED_LTI_BLOCK
# .. toggle_default: True
# .. toggle_implementation: DjangoSetting
# .. toggle_description: Enables the use of the extracted LTI XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2024-11-10
# .. toggle_target_removal_date: 2026-04-10
USE_EXTRACTED_LTI_BLOCK = True

# .. toggle_name: USE_EXTRACTED_HTML_BLOCK
# .. toggle_default: True
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ itembank = "xmodule.item_bank_block:ItemBankBlock"
image = "xmodule.template_block:TranslateCustomTagBlock"
library = "xmodule.library_root_xblock:LibraryRoot"
library_content = "xmodule.library_content_block:LegacyLibraryContentBlock"
lti = "xmodule.lti_block:LTIBlock"
lti = "xblocks_contrib:LTIBlock"
poll_question = "xmodule.poll_block:PollBlock"
problem = "xmodule.capa_block:ProblemBlock"
randomize = "xmodule.randomize_block:RandomizeBlock"
Expand Down
8 changes: 0 additions & 8 deletions webpack.builtinblocks.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ module.exports = {
'./xmodule/js/src/xmodule.js',
'./xmodule/js/src/vertical/edit.js'
],
LTIBlockDisplay: [
'./xmodule/js/src/xmodule.js',
'./xmodule/js/src/lti/lti.js'
],
LTIBlockEditor: [
'./xmodule/js/src/xmodule.js',
'./xmodule/js/src/raw/edit/metadata-only.js'
],
PollBlockDisplay: [
'./xmodule/js/src/xmodule.js',
'./xmodule/js/src/javascript_loader.js',
Expand Down
10 changes: 1 addition & 9 deletions webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,7 @@ module.exports = Merge.merge({
}
]
},
{
test: /xmodule\/js\/src\/lti\/lti.js/,
use: [
{
loader: 'imports-loader',
options: 'this=>window'
}
]
},

{
test: /xmodule\/js\/src\/poll\/poll.js/,
use: [
Expand Down
37 changes: 0 additions & 37 deletions xmodule/js/fixtures/lti.html

This file was deleted.

34 changes: 0 additions & 34 deletions xmodule/js/src/lti/lti.js

This file was deleted.

Loading
Loading