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
27c70ead
Commit
27c70ead
authored
Jul 01, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests and CHANGELOG for LMS-530
parent
5fad9ccc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletions
+24
-1
CHANGELOG.rst
+2
-0
lms/djangoapps/staticbook/tests.py
+22
-1
No files found.
CHANGELOG.rst
View file @
27c70ead
...
@@ -15,6 +15,8 @@ LMS: Users are no longer auto-activated if they click "reset password"
...
@@ -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
This is now done when they click on the link in the reset password
email they receive (along with usual path through activation email).
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
LMS: Problem rescoring. Added options on the Grades tab of the
Instructor Dashboard to allow a particular student's submission for a
Instructor Dashboard to allow a particular student's submission for a
particular problem to be rescored. Provides an option to see a
particular problem to be rescored. Provides an option to see a
...
...
lms/djangoapps/staticbook/tests.py
View file @
27c70ead
...
@@ -3,7 +3,7 @@ Test the lms/staticbook views.
...
@@ -3,7 +3,7 @@ Test the lms/staticbook views.
"""
"""
from
django.test.utils
import
override_settings
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
courseware.tests.tests
import
TEST_DATA_MONGO_MODULESTORE
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
...
@@ -115,6 +115,20 @@ class StaticPdfBookTest(StaticBookTest):
...
@@ -115,6 +115,20 @@ class StaticPdfBookTest(StaticBookTest):
response
=
self
.
client
.
get
(
url
)
response
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
response
.
status_code
,
404
)
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
):
class
StaticHtmlBookTest
(
StaticBookTest
):
"""
"""
...
@@ -150,3 +164,10 @@ class StaticHtmlBookTest(StaticBookTest):
...
@@ -150,3 +164,10 @@ class StaticHtmlBookTest(StaticBookTest):
url
=
self
.
make_url
(
'html_book'
,
book_index
=
0
,
chapter
=
1
)
url
=
self
.
make_url
(
'html_book'
,
book_index
=
0
,
chapter
=
1
)
response
=
self
.
client
.
get
(
url
)
response
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
response
.
status_code
,
404
)
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'
})
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