'In case of mongo, 1 query is used to fetch the block, and 2
by path_to_location(), and then 1 query per parent in path
is needed to fetch the parent blocks.'

@ddt.data((ModuleStoreEnum.Type.mongo, 'course', [], 3), (ModuleStoreEnum.Type.mongo, 'chapter_1', [], 3), (ModuleStoreEnum.Type.mongo, 'sequential_1', ['chapter_1'], 4), (ModuleStoreEnum.Type.mongo, 'vertical_1', ['chapter_1', 'sequential_1'], 6), (ModuleStoreEnum.Type.mongo, 'html_1', ['chapter_1', 'sequential_2', 'vertical_2'], 7), (ModuleStoreEnum.Type.split, 'course', [], 3), (ModuleStoreEnum.Type.split, 'chapter_1', [], 2), (ModuleStoreEnum.Type.split, 'sequential_1', ['chapter_1'], 2), (ModuleStoreEnum.Type.split, 'vertical_1', ['chapter_1', 'sequential_1'], 2), (ModuleStoreEnum.Type.split, 'html_1', ['chapter_1', 'sequential_2', 'vertical_2'], 2))
@ddt.unpack
def test_path_and_queries_on_create(self, store_type, block_to_bookmark, ancestors_attrs, expected_mongo_calls):

    self.setup_data(store_type)
    user = UserFactory.create()
    expected_path = [PathItem(usage_key=getattr(self, ancestor_attr).location, display_name=getattr(self, ancestor_attr).display_name) for ancestor_attr in ancestors_attrs]
    bookmark_data = self.get_bookmark_data(getattr(self, block_to_bookmark), user=user)
    with check_mongo_calls(expected_mongo_calls):
        (bookmark, __) = Bookmark.create(bookmark_data)
    self.assertEqual(bookmark.path, expected_path)
    self.assertIsNotNone(bookmark.xblock_cache)
    self.assertEqual(bookmark.xblock_cache.paths, [])
