'Test the get_courses_for_wiki method'

def test_get_courses_for_wiki(self):

    store = XMLModuleStore(DATA_DIR, source_dirs=['toy', 'simple'])
    for course in store.get_courses():
        course_locations = store.get_courses_for_wiki(course.wiki_slug)
        self.assertEqual(len(course_locations), 1)
        self.assertIn(course.location.course_key, course_locations)
    course_locations = store.get_courses_for_wiki('no_such_wiki')
    self.assertEqual(len(course_locations), 0)
    toy_course = store.get_course(CourseKey.from_string('edX/toy/2012_Fall'))
    toy_course.wiki_slug = 'simple'
    course_locations = store.get_courses_for_wiki('toy')
    self.assertEqual(len(course_locations), 0)
    course_locations = store.get_courses_for_wiki('simple')
    self.assertEqual(len(course_locations), 2)
    for course_number in ['toy', 'simple']:
        self.assertIn(CourseKey.from_string('/'.join(['edX', course_number, '2012_Fall'])), course_locations)
