From f7a83cdc74507bb4059c82c631851480d8ad45c6 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Wed, 3 Apr 2013 14:03:14 -0400 Subject: [PATCH] wip: add test case for exporting/importing a private module --- .../contentstore/tests/test_contentstore.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index b2962d717d..dcdba45ac5 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -302,6 +302,16 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): root_dir = path(mkdtemp_clean()) + # now create a private vertical + private_vertical = draft_store.clone_item(vertical.location, + Location(['i4x', 'edX', 'full', 'vertical', 'a_private_vertical', None])) + + # add private to list of children + sequential = module_store.get_item(Location(['i4x', 'edX', 'full', + 'sequential', 'Administrivia_and_Circuit_Elements', None])) + module_store.update_children(sequential.location, sequential.children + [private_vertical.location.url()]) + + print 'Exporting to tempdir = {0}'.format(root_dir) # export out to a tempdir @@ -357,6 +367,12 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): for child in vertical.get_children(): self.assertTrue(hasattr(child, 'is_draft')) + # verify that we have the private vertical + test_private_vertical = draft_store.get_item(Location(['i4x', 'edX', 'full', + 'vertical', 'vertical_66', None])) + + self.assertTrue(hasattr(test_private_vertical, 'is_draft')) + shutil.rmtree(root_dir) def test_course_handouts_rewrites(self):