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:
chrisndodge
2013-08-27 18:21:27 -07:00
4 changed files with 9 additions and 1 deletions

View File

@@ -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')

View File

@@ -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

View File

@@ -0,0 +1 @@
<div>resources!</div>

View File

@@ -0,0 +1 @@
<h1>This is a syllabus</h1>