""" Python tests for the Survey views """ import json from collections import OrderedDict from django.test.client import Client from django.urls import reverse from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.survey.models import SurveyAnswer, SurveyForm from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory class SurveyViewsTests(ModuleStoreTestCase): """ All tests for the views.py file """ def setUp(self): """ Set up the test data used in the specific tests """ super().setUp() self.client = Client() # Create two accounts self.password = 'abc' self.student = UserFactory.create(username='student', email='student@test.com', password=self.password) self.test_survey_name = 'TestSurvey' self.test_form = '''