'Make sure that we can query for a filtered list of courses for a given ORG'

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

    courses = self.draft_store.get_courses(org='guestx')
    assert_equals(len(courses), 1)
    course_ids = [course.id for course in courses]
    for course_key in [CourseKey.from_string('/'.join(fields)) for fields in [['guestx', 'foo', 'bar']]]:
        assert_in(course_key, course_ids)
    courses = self.draft_store.get_courses(org='edX')
    assert_equals(len(courses), 5)
    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']]]:
        assert_in(course_key, course_ids)
