def test_can_handle_without_parent(self): """ Test if it possible to handle case when split_test has no parent. """ self._add_user_partitions() # Create split test without parent. ItemFactory.create(category='split_test', user_partition_id=0, display_name='Test Content Experiment') self.save_course() actual = GroupConfiguration.get_usage_info(self.course, self.store) self.assertEqual(actual, {0: []})
def test_can_handle_without_parent(self): """ Test if it possible to handle case when split_test has no parent. """ self._add_user_partitions() # Create split test without parent. ItemFactory.create( category='split_test', user_partition_id=0, display_name='Test Content Experiment' ) self.save_course() actual = GroupConfiguration.get_usage_info(self.course, self.store) self.assertEqual(actual, {0: []})
def test_can_handle_without_parent(self): """ Test if it possible to handle case when split_test has no parent. """ self._add_user_partitions() # Create split test without parent. with modulestore().branch_setting(ModuleStoreEnum.Branch.published_only): orphan = modulestore().create_item( ModuleStoreEnum.UserID.test, self.course.id, 'split_test', ) orphan.user_partition_id = 0 orphan.display_name = 'Test Content Experiment' modulestore().update_item(orphan, ModuleStoreEnum.UserID.test) self.save_course() actual = GroupConfiguration.get_usage_info(self.course, self.store) self.assertEqual(actual, {0: []})