'Create a course with assets, copy them all to another course in the same modulestore, and check on it.'

@ddt.data(*MODULESTORE_SETUPS)
def test_copy_all_assets_same_modulestore(self, storebuilder):

    with storebuilder.build() as (__, store):
        course1 = CourseFactory.create(modulestore=store)
        course2 = CourseFactory.create(modulestore=store)
        self.setup_assets(course1.id, None, store)
        self.assertEquals(len(store.get_all_asset_metadata(course1.id, 'asset')), 2)
        self.assertEquals(len(store.get_all_asset_metadata(course2.id, 'asset')), 0)
        store.copy_all_asset_metadata(course1.id, course2.id, (ModuleStoreEnum.UserID.test * 101))
        self.assertEquals(len(store.get_all_asset_metadata(course1.id, 'asset')), 2)
        all_assets = store.get_all_asset_metadata(course2.id, 'asset', sort=('displayname', ModuleStoreEnum.SortOrder.ascending))
        self.assertEquals(len(all_assets), 2)
        self.assertEquals(all_assets[0].asset_id.path, 'pic1.jpg')
        self.assertEquals(all_assets[1].asset_id.path, 'shout.ogg')
