'Helper for asserting that all image_urls are defaulting to a particular value.
Returns the CourseOverview created. This function is useful when you
know that the thumbnail generation process is going to fail in some way
(e.g. unspecified source image, disabled config, runtime error) and want
to verify that all the image URLs are a certain expected value (either
the source image, or the fallback URL).'

def _assert_image_urls_all_default(self, modulestore_type, raw_course_image_name, expected_url=None):

    with self.store.default_store(modulestore_type):
        course = CourseFactory.create(default_store=modulestore_type, course_image=raw_course_image_name)
        if (expected_url is None):
            expected_url = course_image_url(course)
        course_overview = CourseOverview.get_from_id(course.id)
        self.assertEqual(course_overview.image_urls, {'raw': expected_url, 'small': expected_url, 'large': expected_url})
        return course_overview
