refactor: remove unused MakoModuleDescriptor

This commit is contained in:
Maxim Beder
2022-10-20 16:42:14 +02:00
committed by Maxim Beder
parent 995713c6c6
commit 98d9e622b4
2 changed files with 1 additions and 38 deletions

View File

@@ -4,9 +4,8 @@ Code to handle mako templating for XModules and XBlocks.
from web_fragments.fragment import Fragment
from xblock.core import XBlock
from .x_module import DescriptorSystem, shim_xmodule_js, XModuleMixin
from .x_module import DescriptorSystem, shim_xmodule_js
class MakoDescriptorSystem(DescriptorSystem): # lint-amnesty, pylint: disable=abstract-method
@@ -72,14 +71,3 @@ class MakoTemplateBlockBase:
)
shim_xmodule_js(fragment, self.js_module_name)
return fragment
@XBlock.needs("i18n")
class MakoModuleDescriptor(MakoTemplateBlockBase, XModuleMixin): # pylint: disable=abstract-method
"""
Mixin to use for XModule descriptors.
"""
resources_dir = None
def get_html(self):
return self.studio_view(None).content

View File

@@ -1,25 +0,0 @@
""" Test mako_module.py """
from unittest import TestCase
from unittest.mock import Mock
import pytest
from xmodule.mako_module import MakoModuleDescriptor
class MakoModuleTest(TestCase):
""" Test MakoModuleDescriptor """
def test_render_template_check(self):
mock_system = Mock()
mock_system.render_template = None
with pytest.raises(TypeError):
MakoModuleDescriptor(mock_system, {})
del mock_system.render_template
with pytest.raises(TypeError):
MakoModuleDescriptor(mock_system, {})