'Verify that filtering performs as expected.'

def test_get_courses_with_filter(self):

    user = UserFactory.create()
    non_mobile_course = CourseFactory.create(emit_signals=True)
    mobile_course = CourseFactory.create(mobile_available=True, emit_signals=True)
    test_cases = ((None, {non_mobile_course.id, mobile_course.id}), (dict(mobile_available=True), {mobile_course.id}), (dict(mobile_available=False), {non_mobile_course.id}))
    for (filter_, expected_courses) in test_cases:
        self.assertEqual({course.id for course in get_courses(user, filter_=filter_)}, expected_courses, 'testing    get_courses    with    filter_={}'.format(filter_))
