'Check that courses with unicode characters in filenames and in
org/course/name import properly. Currently, this means: (a) Having
files with unicode names does not prevent import; (b) if files are not
loaded because of unicode filenames, there are appropriate
exceptions/errors to that effect.'

def test_unicode(self):

    print 'Starting    import'
    modulestore = XMLModuleStore(DATA_DIR, source_dirs=['test_unicode'])
    courses = modulestore.get_courses()
    self.assertEquals(len(courses), 1)
    course = courses[0]
    print 'course    errors:'
    expect = 'InvalidKeyError'
    errors = [(msg.encode('utf-8'), err.encode('utf-8')) for (msg, err) in modulestore.get_course_errors(course.id)]
    self.assertTrue(any((((expect in msg) or (expect in err)) for (msg, err) in errors)))
    chapters = course.get_children()
    self.assertEqual(len(chapters), 4)
