'test to generate course survey report
and then test the report authenticity.'

@patch.dict('django.conf.settings.FEATURES', {'ENABLE_PAID_COURSE_REGISTRATION': True})
def test_generate_course_survey_report(self):

    task_input = {'features': []}
    with patch('lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task'):
        result = upload_course_survey_report(None, None, self.course.id, task_input, 'generating    course    survey    report')
    report_store = ReportStore.from_config(config_name='GRADES_DOWNLOAD')
    header_row = ','.join(['User    ID', 'User    Name', 'Email', self.question1, self.question2, self.question3])
    student1_row = ','.join([str(self.student1.id), self.student1.username, self.student1.email, self.answer1, self.answer2])
    student2_row = ','.join([str(self.student2.id), self.student2.username, self.student2.email, self.answer3, self.answer2, self.answer1])
    expected_data = [header_row, student1_row, student2_row]
    self.assertDictContainsSubset({'attempted': 2, 'succeeded': 2, 'failed': 0}, result)
    self._verify_csv_file_report(report_store, expected_data)
