Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
27c70ead
Commit
27c70ead
authored
11 years ago
by
Ned Batchelder
Browse files
Options
Downloads
Patches
Plain Diff
Tests and CHANGELOG for LMS-530
parent
5fad9ccc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+2
-0
2 additions, 0 deletions
CHANGELOG.rst
lms/djangoapps/staticbook/tests.py
+22
-1
22 additions, 1 deletion
lms/djangoapps/staticbook/tests.py
with
24 additions
and
1 deletion
CHANGELOG.rst
+
2
−
0
View file @
27c70ead
...
...
@@ -15,6 +15,8 @@ LMS: Users are no longer auto-activated if they click "reset password"
This is now done when they click on the link in the reset password
email they receive (along with usual path through activation email).
LMS: Fixed a reflected XSS problem in the static textbook views.
LMS: Problem rescoring. Added options on the Grades tab of the
Instructor Dashboard to allow a particular student's submission for a
particular problem to be rescored. Provides an option to see a
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/staticbook/tests.py
+
22
−
1
View file @
27c70ead
...
...
@@ -3,7 +3,7 @@ Test the lms/staticbook views.
"""
from
django.test.utils
import
override_settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
,
NoReverseMatch
from
courseware.tests.tests
import
TEST_DATA_MONGO_MODULESTORE
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
...
...
@@ -115,6 +115,20 @@ class StaticPdfBookTest(StaticBookTest):
response
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
response
.
status_code
,
404
)
def
test_chapter_xss
(
self
):
# The chapter in the URL used to go right on the page.
course
=
self
.
make_course
(
pdf_textbooks
=
[
PDF_BOOK
])
# It's no longer possible to use a non-integer chapter.
with
self
.
assertRaises
(
NoReverseMatch
):
reverse
(
'
pdf_book
'
,
kwargs
=
{
'
course_id
'
:
course
.
id
,
'
book_index
'
:
0
,
'
chapter
'
:
'
xyzzy
'
})
def
test_page_xss
(
self
):
# The page in the URL used to go right on the page.
course
=
self
.
make_course
(
pdf_textbooks
=
[
PDF_BOOK
])
# It's no longer possible to use a non-integer page.
with
self
.
assertRaises
(
NoReverseMatch
):
reverse
(
'
pdf_book
'
,
kwargs
=
{
'
course_id
'
:
course
.
id
,
'
book_index
'
:
0
,
'
page
'
:
'
xyzzy
'
})
class
StaticHtmlBookTest
(
StaticBookTest
):
"""
...
...
@@ -150,3 +164,10 @@ class StaticHtmlBookTest(StaticBookTest):
url
=
self
.
make_url
(
'
html_book
'
,
book_index
=
0
,
chapter
=
1
)
response
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
response
.
status_code
,
404
)
def
test_chapter_xss
(
self
):
# The chapter in the URL used to go right on the page.
course
=
self
.
make_course
(
pdf_textbooks
=
[
HTML_BOOK
])
# It's no longer possible to use a non-integer chapter.
with
self
.
assertRaises
(
NoReverseMatch
):
reverse
(
'
html_book
'
,
kwargs
=
{
'
course_id
'
:
course
.
id
,
'
book_index
'
:
0
,
'
chapter
'
:
'
xyzzy
'
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment