'Save a list of asset metadata all at once - but with one asset\'s metadata from a different course.'

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

    with storebuilder.build() as (__, store):
        course1 = CourseFactory.create(modulestore=store)
        course2 = CourseFactory.create(modulestore=store)
        md_list = []
        for (asset_type, filename) in self.alls:
            if (asset_type == 'asset'):
                asset_key = course2.id.make_asset_key(asset_type, filename)
            else:
                asset_key = course1.id.make_asset_key(asset_type, filename)
            md_list.append(self._make_asset_thumbnail_metadata(self._make_asset_metadata(asset_key)))
        store.save_asset_metadata_list(md_list, ModuleStoreEnum.UserID.test)
        for (asset_type, asset_list) in (('different', self.differents), ('vrml', self.vrmls)):
            assets = store.get_all_asset_metadata(course1.id, asset_type)
            self.assertEquals(len(assets), len(asset_list))
            self._check_asset_values(assets, asset_list)
        self.assertEquals(len(store.get_all_asset_metadata(course1.id, 'asset')), 0)
        self.assertEquals(len(store.get_all_asset_metadata(course1.id, None)), 3)
        assets = store.get_all_asset_metadata(course1.id, None, start=0, maxresults=(-1), sort=('displayname', ModuleStoreEnum.SortOrder.ascending))
        self.assertEquals(len(assets), len((self.differents + self.vrmls)))
        self._check_asset_values(assets, (self.differents + self.vrmls))
