'Make sure the course objects loaded properly'

@patch('xmodule.tabs.CourseTab.from_json', side_effect=mock_tab_from_json)
def test_get_courses(self, _from_json):

    courses = self.draft_store.get_courses()
    assert_equals(len(courses), 6)
    course_ids = [course.id for course in courses]
    for course_key in [CourseKey.from_string('/'.join(fields)) for fields in [['edX', 'simple', '2012_Fall'], ['edX', 'simple_with_draft', '2012_Fall'], ['edX', 'test_import_course', '2012_Fall'], ['edX', 'test_unicode', '2012_Fall'], ['edX', 'toy', '2012_Fall'], ['guestx', 'foo', 'bar']]]:
        assert_in(course_key, course_ids)
        course = self.draft_store.get_course(course_key)
        assert_not_none(course)
        assert_true(self.draft_store.has_course(course_key))
        mix_cased = CourseKey.from_string('/'.join([course_key.org.upper(), course_key.course.upper(), course_key.run.lower()]))
        assert_false(self.draft_store.has_course(mix_cased))
        assert_true(self.draft_store.has_course(mix_cased, ignore_case=True))
