Merge pull request #813 from edx/bugfix/ichuang/course-tabs-None
bugfix: Course static_tabs importing with display_name = "None"
This commit is contained in:
@@ -127,3 +127,9 @@ class ContentStoreImportNoStaticTest(ModuleStoreTestCase):
|
||||
|
||||
handouts = module_store.get_item(Location(['i4x', 'edX', 'toy', 'html', 'toyhtml', None]))
|
||||
self.assertIn('/static/', handouts.data)
|
||||
|
||||
def test_tab_name_imports_correctly(self):
|
||||
module_store, content_store, course, course_location = self.load_test_import_course()
|
||||
print "course tabs = {0}".format(course.tabs)
|
||||
self.assertEqual(course.tabs[2]['name'],'Syllabus')
|
||||
|
||||
|
||||
@@ -794,7 +794,7 @@ class MongoModuleStore(ModuleStoreBase):
|
||||
existing_tabs = course.tabs or []
|
||||
for tab in existing_tabs:
|
||||
if tab.get('url_slug') == loc.name:
|
||||
tab['name'] = metadata.get('display_name')
|
||||
tab['name'] = tab.get('name', metadata.get('display_name'))
|
||||
break
|
||||
course.tabs = existing_tabs
|
||||
# Save the updates to the course to the MongoKeyValueStore
|
||||
|
||||
1
common/test/data/test_import_course/tabs/resources.html
Normal file
1
common/test/data/test_import_course/tabs/resources.html
Normal file
@@ -0,0 +1 @@
|
||||
<div>resources!</div>
|
||||
1
common/test/data/test_import_course/tabs/syllabus.html
Normal file
1
common/test/data/test_import_course/tabs/syllabus.html
Normal file
@@ -0,0 +1 @@
|
||||
<h1>This is a syllabus</h1>
|
||||
Reference in New Issue
Block a user