'Test that we get back the appropriate usage key for the root of a course key.
In particular, we want to make sure that it properly handles CCX courses.'

@ddt.data(('course-v1:edx+test_course+test_run', BlockUsageLocator), ('ccx-v1:edX+test_course+test_run+ccx@1', CCXBlockUsageLocator))
@ddt.unpack
def test_make_course_usage_key(self, course_id, root_block_cls):

    course_key = CourseKey.from_string(course_id)
    root_block_key = modulestore().make_course_usage_key(course_key)
    self.assertIsInstance(root_block_key, root_block_cls)
    self.assertEqual(root_block_key.block_type, 'course')
    self.assertEqual(root_block_key.name, 'course')
