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
c450145f
Commit
c450145f
authored
Dec 07, 2015
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update CMS Contentstore tests to not use ORA1 examples
parent
e023fb25
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
67 deletions
+20
-67
cms/djangoapps/contentstore/tests/test_contentstore.py
+1
-1
cms/djangoapps/contentstore/tests/test_course_settings.py
+2
-29
cms/djangoapps/contentstore/tests/test_import.py
+0
-20
cms/djangoapps/contentstore/views/tests/test_item.py
+17
-17
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
c450145f
...
@@ -698,7 +698,7 @@ class MiscCourseTests(ContentStoreTestCase):
...
@@ -698,7 +698,7 @@ class MiscCourseTests(ContentStoreTestCase):
self
.
check_components_on_page
(
self
.
check_components_on_page
(
ADVANCED_COMPONENT_TYPES
,
ADVANCED_COMPONENT_TYPES
,
[
'Word cloud'
,
'Annotation'
,
'Text Annotation'
,
'Video Annotation'
,
'Image Annotation'
,
[
'Word cloud'
,
'Annotation'
,
'Text Annotation'
,
'Video Annotation'
,
'Image Annotation'
,
'
Open Response Assessment'
,
'Peer Grading Interface'
,
'
split_test'
],
'split_test'
],
)
)
@ddt.data
(
'/Fake/asset/displayname'
,
'
\\
Fake
\\
asset
\\
displayname'
)
@ddt.data
(
'/Fake/asset/displayname'
,
'
\\
Fake
\\
asset
\\
displayname'
)
...
...
cms/djangoapps/contentstore/tests/test_course_settings.py
View file @
c450145f
...
@@ -905,48 +905,21 @@ class CourseMetadataEditingTest(CourseTestCase):
...
@@ -905,48 +905,21 @@ class CourseMetadataEditingTest(CourseTestCase):
"""
"""
Test that adding and removing specific advanced components adds and removes tabs.
Test that adding and removing specific advanced components adds and removes tabs.
"""
"""
open_ended_tab
=
{
"type"
:
"open_ended"
,
"name"
:
"Open Ended Panel"
}
peer_grading_tab
=
{
"type"
:
"peer_grading"
,
"name"
:
"Peer grading"
}
# First ensure that none of the tabs are visible
# First ensure that none of the tabs are visible
self
.
assertNotIn
(
open_ended_tab
,
self
.
course
.
tabs
)
self
.
assertNotIn
(
peer_grading_tab
,
self
.
course
.
tabs
)
self
.
assertNotIn
(
self
.
notes_tab
,
self
.
course
.
tabs
)
self
.
assertNotIn
(
self
.
notes_tab
,
self
.
course
.
tabs
)
# Now add the "combinedopenended" component and verify that the tab has been added
# Now enable student notes and verify that the "My Notes" tab has been added
self
.
client
.
ajax_post
(
self
.
course_setting_url
,
{
ADVANCED_COMPONENT_POLICY_KEY
:
{
"value"
:
[
"combinedopenended"
]}
})
course
=
modulestore
()
.
get_course
(
self
.
course
.
id
)
self
.
assertIn
(
open_ended_tab
,
course
.
tabs
)
self
.
assertIn
(
peer_grading_tab
,
course
.
tabs
)
self
.
assertNotIn
(
self
.
notes_tab
,
course
.
tabs
)
# Now enable student notes and verify that the "My Notes" tab has also been added
self
.
client
.
ajax_post
(
self
.
course_setting_url
,
{
ADVANCED_COMPONENT_POLICY_KEY
:
{
"value"
:
[
"combinedopenended"
,
"notes"
]}
})
course
=
modulestore
()
.
get_course
(
self
.
course
.
id
)
self
.
assertIn
(
open_ended_tab
,
course
.
tabs
)
self
.
assertIn
(
peer_grading_tab
,
course
.
tabs
)
self
.
assertIn
(
self
.
notes_tab
,
course
.
tabs
)
# Now remove the "combinedopenended" component and verify that the tab is gone
self
.
client
.
ajax_post
(
self
.
course_setting_url
,
{
self
.
client
.
ajax_post
(
self
.
course_setting_url
,
{
ADVANCED_COMPONENT_POLICY_KEY
:
{
"value"
:
[
"notes"
]}
ADVANCED_COMPONENT_POLICY_KEY
:
{
"value"
:
[
"notes"
]}
})
})
course
=
modulestore
()
.
get_course
(
self
.
course
.
id
)
course
=
modulestore
()
.
get_course
(
self
.
course
.
id
)
self
.
assertNotIn
(
open_ended_tab
,
course
.
tabs
)
self
.
assertNotIn
(
peer_grading_tab
,
course
.
tabs
)
self
.
assertIn
(
self
.
notes_tab
,
course
.
tabs
)
self
.
assertIn
(
self
.
notes_tab
,
course
.
tabs
)
#
Finally d
isable student notes and verify that the "My Notes" tab is gone
#
D
isable student notes and verify that the "My Notes" tab is gone
self
.
client
.
ajax_post
(
self
.
course_setting_url
,
{
self
.
client
.
ajax_post
(
self
.
course_setting_url
,
{
ADVANCED_COMPONENT_POLICY_KEY
:
{
"value"
:
[
""
]}
ADVANCED_COMPONENT_POLICY_KEY
:
{
"value"
:
[
""
]}
})
})
course
=
modulestore
()
.
get_course
(
self
.
course
.
id
)
course
=
modulestore
()
.
get_course
(
self
.
course
.
id
)
self
.
assertNotIn
(
open_ended_tab
,
course
.
tabs
)
self
.
assertNotIn
(
peer_grading_tab
,
course
.
tabs
)
self
.
assertNotIn
(
self
.
notes_tab
,
course
.
tabs
)
self
.
assertNotIn
(
self
.
notes_tab
,
course
.
tabs
)
def
test_advanced_components_munge_tabs_validation_failure
(
self
):
def
test_advanced_components_munge_tabs_validation_failure
(
self
):
...
...
cms/djangoapps/contentstore/tests/test_import.py
View file @
c450145f
...
@@ -219,26 +219,6 @@ class ContentStoreImportTest(SignalDisconnectTestMixin, ModuleStoreTestCase):
...
@@ -219,26 +219,6 @@ class ContentStoreImportTest(SignalDisconnectTestMixin, ModuleStoreTestCase):
conditional_module
.
show_tag_list
conditional_module
.
show_tag_list
)
)
def
test_rewrite_reference
(
self
):
module_store
=
modulestore
()
target_id
=
module_store
.
make_course_key
(
'testX'
,
'peergrading_copy'
,
'copy_run'
)
import_course_from_xml
(
module_store
,
self
.
user
.
id
,
TEST_DATA_DIR
,
[
'open_ended'
],
target_id
=
target_id
,
create_if_not_present
=
True
)
peergrading_module
=
module_store
.
get_item
(
target_id
.
make_usage_key
(
'peergrading'
,
'PeerGradingLinked'
)
)
self
.
assertIsNotNone
(
peergrading_module
)
self
.
assertEqual
(
target_id
.
make_usage_key
(
'combinedopenended'
,
'SampleQuestion'
),
peergrading_module
.
link_to_location
)
def
test_rewrite_reference_value_dict_published
(
self
):
def
test_rewrite_reference_value_dict_published
(
self
):
"""
"""
Test rewriting references in ReferenceValueDict, specifically with published content.
Test rewriting references in ReferenceValueDict, specifically with published content.
...
...
cms/djangoapps/contentstore/views/tests/test_item.py
View file @
c450145f
...
@@ -1388,28 +1388,28 @@ class TestComponentTemplates(CourseTestCase):
...
@@ -1388,28 +1388,28 @@ class TestComponentTemplates(CourseTestCase):
Test the handling of advanced problem templates.
Test the handling of advanced problem templates.
"""
"""
problem_templates
=
self
.
get_templates_of_type
(
'problem'
)
problem_templates
=
self
.
get_templates_of_type
(
'problem'
)
ora_template
=
self
.
get_template
(
problem_templates
,
u'Peer Assessment
'
)
circuit_template
=
self
.
get_template
(
problem_templates
,
u'Circuit Schematic Builder
'
)
self
.
assertIsNotNone
(
ora
_template
)
self
.
assertIsNotNone
(
circuit
_template
)
self
.
assertEqual
(
ora_template
.
get
(
'category'
),
'openassessment
'
)
self
.
assertEqual
(
circuit_template
.
get
(
'category'
),
'problem
'
)
self
.
assert
IsNone
(
ora_template
.
get
(
'boilerplate_name'
,
None
)
)
self
.
assert
Equal
(
circuit_template
.
get
(
'boilerplate_name'
),
'circuitschematic.yaml'
)
@patch
(
'django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES'
,
[
"
combinedopenended"
,
"peergrading
"
])
@patch
(
'django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES'
,
[
"
poll"
,
"survey
"
])
def
test_
ora1
_no_advance_component_button
(
self
):
def
test_
deprecated
_no_advance_component_button
(
self
):
"""
"""
Test that there will be no `Advanced` button on unit page if
`combinedopenended` and `peergrading`
are
Test that there will be no `Advanced` button on unit page if
units
are
deprecated provided that the
re are only 'combinedopenended', 'peergrading'
modules in `Advanced Module List`
deprecated provided that the
y are the only
modules in `Advanced Module List`
"""
"""
self
.
course
.
advanced_modules
.
extend
([
'
combinedopenended'
,
'peergrading
'
])
self
.
course
.
advanced_modules
.
extend
([
'
poll'
,
'survey
'
])
templates
=
get_component_templates
(
self
.
course
)
templates
=
get_component_templates
(
self
.
course
)
button_names
=
[
template
[
'display_name'
]
for
template
in
templates
]
button_names
=
[
template
[
'display_name'
]
for
template
in
templates
]
self
.
assertNotIn
(
'Advanced'
,
button_names
)
self
.
assertNotIn
(
'Advanced'
,
button_names
)
@patch
(
'django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES'
,
[
"
combinedopenended"
,
"peergrading
"
])
@patch
(
'django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES'
,
[
"
poll"
,
"survey
"
])
def
test_cannot_create_
ora1
_problems
(
self
):
def
test_cannot_create_
deprecated
_problems
(
self
):
"""
"""
Test that we can't create
ORA1 problems if `combinedopenended` and `peergrading`
are deprecated
Test that we can't create
problems if they
are deprecated
"""
"""
self
.
course
.
advanced_modules
.
extend
([
'annotatable'
,
'
combinedopenended'
,
'peergrading
'
])
self
.
course
.
advanced_modules
.
extend
([
'annotatable'
,
'
poll'
,
'survey
'
])
templates
=
get_component_templates
(
self
.
course
)
templates
=
get_component_templates
(
self
.
course
)
button_names
=
[
template
[
'display_name'
]
for
template
in
templates
]
button_names
=
[
template
[
'display_name'
]
for
template
in
templates
]
self
.
assertIn
(
'Advanced'
,
button_names
)
self
.
assertIn
(
'Advanced'
,
button_names
)
...
@@ -1418,17 +1418,17 @@ class TestComponentTemplates(CourseTestCase):
...
@@ -1418,17 +1418,17 @@ class TestComponentTemplates(CourseTestCase):
self
.
assertEqual
(
template_display_names
,
[
'Annotation'
])
self
.
assertEqual
(
template_display_names
,
[
'Annotation'
])
@patch
(
'django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES'
,
[])
@patch
(
'django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES'
,
[])
def
test_create_
ora1
_problems
(
self
):
def
test_create_
non_deprecated
_problems
(
self
):
"""
"""
Test that we can create
ORA1 problems if `combinedopenended` and `peergrading`
are not deprecated
Test that we can create
problems if they
are not deprecated
"""
"""
self
.
course
.
advanced_modules
.
extend
([
'annotatable'
,
'
combinedopenended'
,
'peergrading
'
])
self
.
course
.
advanced_modules
.
extend
([
'annotatable'
,
'
poll'
,
'survey
'
])
templates
=
get_component_templates
(
self
.
course
)
templates
=
get_component_templates
(
self
.
course
)
button_names
=
[
template
[
'display_name'
]
for
template
in
templates
]
button_names
=
[
template
[
'display_name'
]
for
template
in
templates
]
self
.
assertIn
(
'Advanced'
,
button_names
)
self
.
assertIn
(
'Advanced'
,
button_names
)
self
.
assertEqual
(
len
(
templates
[
0
][
'templates'
]),
3
)
self
.
assertEqual
(
len
(
templates
[
0
][
'templates'
]),
3
)
template_display_names
=
[
template
[
'display_name'
]
for
template
in
templates
[
0
][
'templates'
]]
template_display_names
=
[
template
[
'display_name'
]
for
template
in
templates
[
0
][
'templates'
]]
self
.
assertEqual
(
template_display_names
,
[
'Annotation'
,
'
Open Response Assessment'
,
'Peer Grading Interface
'
])
self
.
assertEqual
(
template_display_names
,
[
'Annotation'
,
'
Poll'
,
'Survey
'
])
@ddt.ddt
@ddt.ddt
...
...
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