'Tests that the dashboard renders the escaped recent enrollment messages appropriately.'

def test_dashboard_escaped_rendering(self):

    self._configure_message_timeout(600)
    self.client.login(username=self.student.username, password=self.PASSWORD)
    course_location = locator.CourseLocator('TestOrg', 'TestCourse', 'TestRun')
    xss_content = "<script>alert('XSS')</script>"
    course = CourseFactory.create(org=course_location.org, number=course_location.course, run=course_location.run, display_name=xss_content)
    CourseEnrollment.enroll(self.student, course.id)
    response = self.client.get(reverse('dashboard'))
    self.assertContains(response, 'Thank    you    for    enrolling    in')
    self.assert_no_xss(response, xss_content)
