update the attrib using dict-->update() function
This commit is contained in:
committed by
Adam Palay
parent
afec81b662
commit
e7aeb92182
@@ -427,3 +427,20 @@ class ExportTestCase(CourseTestCase):
|
||||
self.assertEqual(video_xml.get('youtube_id_1_0'), youtube_id)
|
||||
finally:
|
||||
shutil.rmtree(root_dir / name)
|
||||
|
||||
def test_export_success_with_custom_tag(self):
|
||||
"""
|
||||
Verify that course export with customtag
|
||||
"""
|
||||
xml_string = '<impl>slides</impl>'
|
||||
vertical = ItemFactory.create(
|
||||
parent_location=self.course.location, category='vertical', display_name='foo'
|
||||
)
|
||||
ItemFactory.create(
|
||||
parent_location=vertical.location,
|
||||
category='customtag',
|
||||
display_name='custom_tag_foo',
|
||||
data=xml_string
|
||||
)
|
||||
|
||||
self.test_export_targz_urlparam()
|
||||
|
||||
@@ -446,7 +446,7 @@ class XmlParserMixin(object):
|
||||
node.tag = xml_object.tag
|
||||
node.text = xml_object.text
|
||||
node.tail = xml_object.tail
|
||||
node.attrib = xml_object.attrib
|
||||
node.attrib.update(xml_object.attrib)
|
||||
node.extend(xml_object)
|
||||
|
||||
node.set('url_name', self.url_name)
|
||||
|
||||
Reference in New Issue
Block a user