diff --git a/cms/djangoapps/contentstore/tests/test_import_nostatic.py b/cms/djangoapps/contentstore/tests/test_import_nostatic.py index 305d986372..f0f65c9b07 100644 --- a/cms/djangoapps/contentstore/tests/test_import_nostatic.py +++ b/cms/djangoapps/contentstore/tests/test_import_nostatic.py @@ -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') + diff --git a/common/lib/xmodule/xmodule/modulestore/mongo/base.py b/common/lib/xmodule/xmodule/modulestore/mongo/base.py index e01606af37..b1fecec120 100644 --- a/common/lib/xmodule/xmodule/modulestore/mongo/base.py +++ b/common/lib/xmodule/xmodule/modulestore/mongo/base.py @@ -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 diff --git a/common/test/data/test_import_course/tabs/resources.html b/common/test/data/test_import_course/tabs/resources.html new file mode 100644 index 0000000000..0f6bdf0984 --- /dev/null +++ b/common/test/data/test_import_course/tabs/resources.html @@ -0,0 +1 @@ +