'Test saving assets using an asset type of \'course_id\'.'

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

    with storebuilder.build() as (__, store):
        course = CourseFactory.create(modulestore=store)
        new_asset_loc = course.id.make_asset_key('course_id', 'just_to_see_if_it_still_works.jpg')
        new_asset_md = self._make_asset_metadata(new_asset_loc)
        store.save_asset_metadata(new_asset_md, ModuleStoreEnum.UserID.test)
        self.assertEquals(len(store.get_all_asset_metadata(course.id, 'course_id')), 1)
        self.assertEquals(len(store.get_all_asset_metadata(course.id, 'asset')), 0)
        all_assets = store.get_all_asset_metadata(course.id, 'course_id')
        self.assertEquals(all_assets[0].asset_id.path, new_asset_loc.path)
