'Test that XSS attack is prevented'

@ddt.data('"><script>alert(1)</script>', '<script>alert(1)</script>', '</script><script>alert(1)</script>')
@patch('student.models.cc.User.from_django_user')
def test_forum_discussion_xss_prevent(self, malicious_code, mock_user, mock_req):

    mock_user.return_value.to_dict.return_value = {}
    reverse_url = ('%s%s' % (reverse('discussion.views.forum_form_discussion', kwargs={'course_id': unicode(self.course.id)}), '/forum_form_discussion'))
    url = ('%s?%s=%s' % (reverse_url, 'sort_key', malicious_code))
    resp = self.client.get(url)
    self.assertEqual(resp.status_code, 200)
    self.assertNotIn(malicious_code, resp.content)
