'Test that raises CommandError if library key is passed'

def test_given_library_key_raises_command_error(self):

    with self.assertRaisesRegexp(CommandError, '.*    is    not    a    course    key'):
        call_command('reindex_course', unicode(self._get_lib_key(self.first_lib)))
    with self.assertRaisesRegexp(CommandError, '.*    is    not    a    course    key'):
        call_command('reindex_course', unicode(self._get_lib_key(self.second_lib)))
    with self.assertRaisesRegexp(CommandError, '.*    is    not    a    course    key'):
        call_command('reindex_course', unicode(self.second_course.id), unicode(self._get_lib_key(self.first_lib)))
