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
11ef3961
Commit
11ef3961
authored
Jul 02, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try to add some additional diff coverage which should get us to 100%
parent
9a8c5857
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
cms/djangoapps/contentstore/tests/test_contentstore.py
+21
-2
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
11ef3961
...
...
@@ -344,8 +344,8 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
err_cnt
=
perform_xlint
(
'common/test/data'
,
[
'full'
])
self
.
assertGreater
(
err_cnt
,
0
)
@override_settings
(
COURSES_WITH_UNSAFE_CODE
=
[
'ed
x
/full/.*'
])
def
test_module_preview
(
self
):
@override_settings
(
COURSES_WITH_UNSAFE_CODE
=
[
'ed
X
/full/.*'
])
def
test_module_preview
_in_whitelist
(
self
):
'''
Tests the ajax callback to render an XModule
'''
...
...
@@ -366,6 +366,25 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
resp
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
@override_settings
(
COURSES_WITH_UNSAFE_CODE
=
[
'edX/dummycourse/.*'
])
def
test_module_preview_not_in_whitelist
(
self
):
'''
Tests the ajax callback to render an XModule problem but we don't have the course listed in
our whitelist.
'''
direct_store
=
modulestore
(
'direct'
)
import_from_xml
(
direct_store
,
'common/test/data/'
,
[
'full'
])
html_module_location
=
Location
([
'i4x'
,
'edX'
,
'full'
,
'html'
,
'html_90'
,
None
])
url
=
reverse
(
'preview_component'
,
kwargs
=
{
'location'
:
html_module_location
.
url
()})
# also try a custom response which will trigger the 'is this course in whitelist' logic
problem_module_location
=
Location
([
'i4x'
,
'edX'
,
'full'
,
'problem'
,
'H1P1_Energy'
,
None
])
url
=
reverse
(
'preview_component'
,
kwargs
=
{
'location'
:
problem_module_location
.
url
()})
resp
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
def
test_delete
(
self
):
direct_store
=
modulestore
(
'direct'
)
import_from_xml
(
direct_store
,
'common/test/data/'
,
[
'full'
])
...
...
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