'Test that when we are running in a partially deployed state (where both
old and new CourseOverview.VERSION values are active), that we behave
properly. This assumes that all updates are backwards compatible, or
at least are backwards compatible between version N and N-1.'

def test_course_overview_version_update(self):

    course = CourseFactory.create()
    with mock.patch('openedx.core.djangoapps.content.course_overviews.models.CourseOverview.VERSION', new=10):
        overview_v10 = CourseOverview.get_from_id(course.id)
        self.assertEqual(overview_v10.version, 10)
        overview_v10.version = 9
        overview_v10.save()
        updated_overview = CourseOverview.get_from_id(course.id)
        self.assertEqual(updated_overview.version, 10)
        updated_overview.version = 11
        updated_overview.save()
        unmodified_overview = CourseOverview.get_from_id(course.id)
        self.assertEqual(unmodified_overview.version, 11)
