From 829cd7d8616563416286657c12f656582e613ff1 Mon Sep 17 00:00:00 2001 From: Zubair Afzal Date: Tue, 26 Nov 2013 14:30:17 +0500 Subject: [PATCH] Fix unique vertical url + add test STUD-979 --- common/lib/xmodule/xmodule/modulestore/xml.py | 2 +- common/lib/xmodule/xmodule/tests/test_import.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/modulestore/xml.py b/common/lib/xmodule/xmodule/modulestore/xml.py index 5512af2143..90e633d8a1 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml.py +++ b/common/lib/xmodule/xmodule/modulestore/xml.py @@ -79,7 +79,7 @@ class ImportSystem(XMLParsingSystem, MakoDescriptorSystem): # tags that really need unique names--they store (or should store) state. need_uniq_names = ('problem', 'sequential', 'video', 'course', 'chapter', - 'videosequence', 'poll_question', 'timelimit') + 'videosequence', 'poll_question', 'timelimit', 'vertical') attr = xml_data.attrib tag = xml_data.tag diff --git a/common/lib/xmodule/xmodule/tests/test_import.py b/common/lib/xmodule/xmodule/tests/test_import.py index 04a4e84f73..c1f4bb2ee2 100644 --- a/common/lib/xmodule/xmodule/tests/test_import.py +++ b/common/lib/xmodule/xmodule/tests/test_import.py @@ -92,6 +92,16 @@ class ImportTestCase(BaseCourseTestCase): self.assertNotEqual(descriptor1.location, descriptor2.location) + # Check that each vertical gets its very own url_name + bad_xml = '''''' + bad_xml2 = '''''' + + descriptor1 = system.process_xml(bad_xml) + descriptor2 = system.process_xml(bad_xml2) + + self.assertNotEqual(descriptor1.location, descriptor2.location) + + def test_reimport(self): '''Make sure an already-exported error xml tag loads properly'''