'Verify grade report data.'

def _verify_csv_data(self, username, expected_data):

    with patch('lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task'):
        CourseGradeReport.generate(None, None, self.course.id, None, 'graded')
        report_store = ReportStore.from_config(config_name='GRADES_DOWNLOAD')
        report_csv_filename = report_store.links_for(self.course.id)[0][0]
        report_path = report_store.path_to(self.course.id, report_csv_filename)
        found_user = False
        with report_store.storage.open(report_path) as csv_file:
            for row in unicodecsv.DictReader(csv_file):
                if (row.get('Username') == username):
                    csv_row_data = [row[column] for column in self.columns_to_check]
                    self.assertEqual(csv_row_data, expected_data)
                    found_user = True
        self.assertTrue(found_user)
