'Verify cell data in the grades CSV for a particular user.'

def _verify_cell_data_for_user(self, username, course_id, column_header, expected_cell_content, num_rows=2):

    with patch('lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task'):
        result = CourseGradeReport.generate(None, None, course_id, None, 'graded')
        self.assertDictContainsSubset({'attempted': num_rows, 'succeeded': num_rows, 'failed': 0}, result)
        report_store = ReportStore.from_config(config_name='GRADES_DOWNLOAD')
        report_csv_filename = report_store.links_for(course_id)[0][0]
        report_path = report_store.path_to(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):
                    self.assertEqual(row[column_header], expected_cell_content)
                    found_user = True
        self.assertTrue(found_user)
