Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
387d4f6a
Commit
387d4f6a
authored
Oct 16, 2015
by
Adam
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10222 from edx/mashtaq/fix-quality-template-escaping
Fix quality for template escaping
parents
a144fdde
1b49f0cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
lms/djangoapps/django_comment_client/forum/tests.py
+2
-3
No files found.
lms/djangoapps/django_comment_client/forum/tests.py
View file @
387d4f6a
...
@@ -1343,14 +1343,13 @@ class ForumDiscussionXSSTestCase(UrlResetMixin, ModuleStoreTestCase):
...
@@ -1343,14 +1343,13 @@ class ForumDiscussionXSSTestCase(UrlResetMixin, ModuleStoreTestCase):
@ddt.data
(
'"><script>alert(1)</script>'
,
'<script>alert(1)</script>'
,
'</script><script>alert(1)</script>'
)
@ddt.data
(
'"><script>alert(1)</script>'
,
'<script>alert(1)</script>'
,
'</script><script>alert(1)</script>'
)
@patch
(
'student.models.cc.User.from_django_user'
)
@patch
(
'student.models.cc.User.from_django_user'
)
def
test_forum_discussion_xss_prevent
(
self
,
malicious_code
,
mock_
from_django_user
,
mock_request
):
def
test_forum_discussion_xss_prevent
(
self
,
malicious_code
,
mock_
user
,
mock_req
):
# pylint: disable=unused-argument
"""
"""
Test that XSS attack is prevented
Test that XSS attack is prevented
"""
"""
reverse_url
=
"
%
s
%
s"
%
(
reverse
(
reverse_url
=
"
%
s
%
s"
%
(
reverse
(
"django_comment_client.forum.views.forum_form_discussion"
,
"django_comment_client.forum.views.forum_form_discussion"
,
kwargs
=
{
"course_id"
:
unicode
(
self
.
course
.
id
)}),
'/forum_form_discussion'
kwargs
=
{
"course_id"
:
unicode
(
self
.
course
.
id
)}),
'/forum_form_discussion'
)
)
# Test that malicious code does not appear in html
# Test that malicious code does not appear in html
url
=
"
%
s?
%
s=
%
s"
%
(
reverse_url
,
'sort_key'
,
malicious_code
)
url
=
"
%
s?
%
s=
%
s"
%
(
reverse_url
,
'sort_key'
,
malicious_code
)
resp
=
self
.
client
.
get
(
url
)
resp
=
self
.
client
.
get
(
url
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment