From 7090ef6588758a37edbd0a7eda391df27da9b5d1 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Fri, 12 Sep 2014 14:41:55 -0400 Subject: [PATCH] Ensure deleting a direct only removes it from published as well as draft LMS-11395 --- .../modulestore/tests/test_mixed_modulestore.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py index 0487aca15a..8b6f6e32c1 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py @@ -661,13 +661,16 @@ class TestMixedModuleStore(unittest.TestCase): with self.assertRaises(NotImplementedError): self.store.delete_item(self.xml_chapter_location, self.user_id) - with check_mongo_calls(max_find, max_send): - self.store.delete_item(self.writable_chapter_location, self.user_id) + with self.store.branch_setting(ModuleStoreEnum.Branch.draft_preferred, self.writable_chapter_location.course_key): + with check_mongo_calls(max_find, max_send): + self.store.delete_item(self.writable_chapter_location, self.user_id) - # verify it's gone - # FIXME check both published and draft branches + # verify it's gone + with self.assertRaises(ItemNotFoundError): + self.store.get_item(self.writable_chapter_location) + # verify it's gone from published too with self.assertRaises(ItemNotFoundError): - self.store.get_item(self.writable_chapter_location) + self.store.get_item(self.writable_chapter_location, revision=ModuleStoreEnum.RevisionOption.published_only) # Draft: # queries: find parent (definition.children), count versions of item, get parent, count grandparents,