'Verify that correct program is returned when the user is enrolled in a
course run appearing in one program.'

def test_single_program_engagement(self, mock_get_programs):

    course_run_key = generate_course_run_key()
    data = [ProgramFactory(courses=[CourseFactory(course_runs=[CourseRunFactory(key=course_run_key)])]), ProgramFactory()]
    mock_get_programs.return_value = data
    self._create_enrollments(course_run_key)
    meter = ProgramProgressMeter(self.site, self.user)
    self._attach_detail_url(data)
    program = data[0]
    self.assertEqual(meter.engaged_programs, [program])
    self._assert_progress(meter, ProgressFactory(uuid=program['uuid'], in_progress=1))
    self.assertEqual(meter.completed_programs, [])
