Commit 2cc72ca0 by Ben McMorran

Show category when an xblock does not have a default display name

parent 0181bb2d
...@@ -372,7 +372,7 @@ def get_component_templates(course): ...@@ -372,7 +372,7 @@ def get_component_templates(course):
if category in ADVANCED_COMPONENT_TYPES and not category in categories: if category in ADVANCED_COMPONENT_TYPES and not category in categories:
# boilerplates not supported for advanced components # boilerplates not supported for advanced components
try: try:
component_display_name = get_component_display_name(category) component_display_name = get_component_display_name(category, default_display_name=category)
advanced_component_templates['templates'].append( advanced_component_templates['templates'].append(
create_template_dict( create_template_dict(
component_display_name, component_display_name,
......
...@@ -1114,6 +1114,15 @@ class TestComponentTemplates(CourseTestCase): ...@@ -1114,6 +1114,15 @@ class TestComponentTemplates(CourseTestCase):
self.assertNotEqual(only_template.get('category'), 'video') self.assertNotEqual(only_template.get('category'), 'video')
self.assertNotEqual(only_template.get('category'), 'openassessment') self.assertNotEqual(only_template.get('category'), 'openassessment')
def test_advanced_components_without_display_name(self):
"""
Test that advanced components without display names display their category instead.
"""
self.course.advanced_modules.append('graphical_slider_tool')
self.templates = get_component_templates(self.course)
template = self.get_templates_of_type('advanced')[0]
self.assertEqual(template.get('display_name'), 'graphical_slider_tool')
def test_advanced_problems(self): def test_advanced_problems(self):
""" """
Test the handling of advanced problem templates. Test the handling of advanced problem templates.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment