From 3020f4af53d8ee67a37f3172234da5fbd1ce34e2 Mon Sep 17 00:00:00 2001 From: Maxim Beder Date: Thu, 20 Oct 2022 16:10:01 +0200 Subject: [PATCH] refactor: remove unused attributes and methods of TabsEditingMixin --- xmodule/editing_module.py | 16 ------------- xmodule/tests/test_editing_module.py | 24 ------------------- .../test_files/test_tabseditingdescriptor.css | 4 ---- .../test_tabseditingdescriptor.scss | 4 ---- 4 files changed, 48 deletions(-) delete mode 100644 xmodule/tests/test_files/test_tabseditingdescriptor.css delete mode 100644 xmodule/tests/test_files/test_tabseditingdescriptor.scss diff --git a/xmodule/editing_module.py b/xmodule/editing_module.py index de609729b4..cd1ac32555 100644 --- a/xmodule/editing_module.py +++ b/xmodule/editing_module.py @@ -3,7 +3,6 @@ import logging -from pkg_resources import resource_string from xblock.fields import Scope, String from xmodule.mako_module import MakoModuleDescriptor, MakoTemplateBlockBase @@ -52,9 +51,6 @@ class TabsEditingMixin(EditingFields, MakoTemplateBlockBase): """ mako_template = "widgets/tabs-aggregator.html" - css = {'scss': [resource_string(__name__, 'css/tabs/tabs.scss')]} - js = {'js': [resource_string( - __name__, 'js/src/tabs/tabs-aggregator.js')]} js_module_name = "TabsEditingDescriptor" tabs = [] @@ -67,18 +63,6 @@ class TabsEditingMixin(EditingFields, MakoTemplateBlockBase): }) return _context - @classmethod - def get_css(cls): # lint-amnesty, pylint: disable=missing-function-docstring - # load every tab's css - for tab in cls.tabs: - tab_styles = tab.get('css', {}) - for css_type, css_content in tab_styles.items(): - if css_type in cls.css: - cls.css[css_type].extend(css_content) - else: - cls.css[css_type] = css_content - return cls.css - class TabsEditingDescriptor(TabsEditingMixin, MakoModuleDescriptor): # lint-amnesty, pylint: disable=abstract-method """ diff --git a/xmodule/tests/test_editing_module.py b/xmodule/tests/test_editing_module.py index 0f29595be6..603054844c 100644 --- a/xmodule/tests/test_editing_module.py +++ b/xmodule/tests/test_editing_module.py @@ -28,20 +28,6 @@ class TabsEditingDescriptorTestCase(unittest.TestCase): 'name': "Test_css", 'template': "tabs/codemirror-edit.html", 'current': True, - 'css': { - 'scss': [ - resource_string( - __name__, - 'test_files/test_tabseditingdescriptor.scss' - ) - ], - 'css': [ - resource_string( - __name__, - 'test_files/test_tabseditingdescriptor.css' - ) - ] - } }, { 'name': "Subtitles", @@ -62,16 +48,6 @@ class TabsEditingDescriptorTestCase(unittest.TestCase): field_data=DictFieldData({}), ) - def test_get_css(self): - """test get_css""" - css = self.descriptor.get_css() - current_dir = os.path.dirname(__file__) - test_css_file = os.path.join(current_dir, 'test_files/test_tabseditingdescriptor.scss') - with open(test_css_file) as new_css: - added_css = new_css.read() - assert css['scss'].pop().decode('utf-8') == added_css - assert css['css'].pop().decode('utf-8') == added_css - def test_get_context(self): """"test get_context""" rendered_context = self.descriptor.get_context() diff --git a/xmodule/tests/test_files/test_tabseditingdescriptor.css b/xmodule/tests/test_files/test_tabseditingdescriptor.css deleted file mode 100644 index e56f54b6f5..0000000000 --- a/xmodule/tests/test_files/test_tabseditingdescriptor.css +++ /dev/null @@ -1,4 +0,0 @@ -.supertestclass { - color: red; -} - diff --git a/xmodule/tests/test_files/test_tabseditingdescriptor.scss b/xmodule/tests/test_files/test_tabseditingdescriptor.scss deleted file mode 100644 index e56f54b6f5..0000000000 --- a/xmodule/tests/test_files/test_tabseditingdescriptor.scss +++ /dev/null @@ -1,4 +0,0 @@ -.supertestclass { - color: red; -} -