From a3de4ff625f0045dbfab1eee11a65ba06a214a6a Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Fri, 5 Apr 2013 15:59:01 -0400 Subject: [PATCH] add unit test to confirm 'id' generation --- .../contentstore/tests/test_contentstore.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 49a609a879..fd3165f4a6 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -578,6 +578,19 @@ class ContentStoreTest(ModuleStoreTestCase): # make sure we found the item (e.g. it didn't error while loading) self.assertTrue(did_load_item) + def test_forum_id_generation(self): + import_from_xml(modulestore(), 'common/test/data/', ['full']) + module_store = modulestore('direct') + new_component_location = Location('i4x', 'edX', 'full', 'discussion', 'new_component') + source_template_location = Location('i4x', 'edx', 'templates', 'discussion', 'Discussion_Tag') + + # crate a new module and add it as a child to a vertical + module_store.clone_item(source_template_location, new_component_location) + + new_discussion_item = module_store.get_item(new_component_location) + + self.assertNotEquals(new_discussion_item.discussion_id, '$$GUID$$') + def test_metadata_inheritance(self): import_from_xml(modulestore(), 'common/test/data/', ['full'])