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
3ae87dd9
Commit
3ae87dd9
authored
Nov 17, 2017
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Studio API to include highlights_enabled_for_messaging
parent
8b0693f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
cms/djangoapps/contentstore/views/item.py
+2
-1
cms/djangoapps/contentstore/views/tests/test_item.py
+4
-1
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
3ae87dd9
...
@@ -1190,8 +1190,9 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
...
@@ -1190,8 +1190,9 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
})
})
elif
xblock
.
category
==
'chapter'
:
elif
xblock
.
category
==
'chapter'
:
xblock_info
.
update
({
xblock_info
.
update
({
'highlights'
:
getattr
(
xblock
,
'highlights'
,
[])
,
'highlights'
:
xblock
.
highlights
,
'highlights_enabled'
:
highlights_setting
.
is_enabled
(),
'highlights_enabled'
:
highlights_setting
.
is_enabled
(),
'highlights_enabled_for_messaging'
:
course
.
highlights_enabled_for_messaging
,
'highlights_preview_only'
:
not
COURSE_UPDATE_WAFFLE_FLAG
.
is_enabled
(
course
.
id
),
'highlights_preview_only'
:
not
COURSE_UPDATE_WAFFLE_FLAG
.
is_enabled
(
course
.
id
),
'highlights_doc_url'
:
HelpUrlExpert
.
the_one
()
.
url_for_token
(
'content_highlights'
),
'highlights_doc_url'
:
HelpUrlExpert
.
the_one
()
.
url_for_token
(
'content_highlights'
),
})
})
...
...
cms/djangoapps/contentstore/views/tests/test_item.py
View file @
3ae87dd9
...
@@ -2573,7 +2573,9 @@ class TestXBlockInfo(ItemTest):
...
@@ -2573,7 +2573,9 @@ class TestXBlockInfo(ItemTest):
self
.
assertEqual
(
xblock_info
[
'start'
],
DEFAULT_START_DATE
.
strftime
(
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
SZ'
))
self
.
assertEqual
(
xblock_info
[
'start'
],
DEFAULT_START_DATE
.
strftime
(
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
SZ'
))
def
test_highlights_enabled
(
self
):
def
test_highlights_enabled
(
self
):
chapter
=
modulestore
()
.
get_item
(
self
.
chapter
.
location
)
self
.
course
.
highlights_enabled_for_messaging
=
True
self
.
store
.
update_item
(
self
.
course
,
None
)
chapter
=
self
.
store
.
get_item
(
self
.
chapter
.
location
)
with
highlights_setting
.
override
():
with
highlights_setting
.
override
():
xblock_info
=
create_xblock_info
(
chapter
)
xblock_info
=
create_xblock_info
(
chapter
)
self
.
assertTrue
(
xblock_info
[
'highlights_enabled'
])
self
.
assertTrue
(
xblock_info
[
'highlights_enabled'
])
...
@@ -2606,6 +2608,7 @@ class TestXBlockInfo(ItemTest):
...
@@ -2606,6 +2608,7 @@ class TestXBlockInfo(ItemTest):
self
.
assertEqual
(
xblock_info
[
'format'
],
None
)
self
.
assertEqual
(
xblock_info
[
'format'
],
None
)
self
.
assertEqual
(
xblock_info
[
'highlights'
],
self
.
chapter
.
highlights
)
self
.
assertEqual
(
xblock_info
[
'highlights'
],
self
.
chapter
.
highlights
)
self
.
assertFalse
(
xblock_info
[
'highlights_enabled'
])
self
.
assertFalse
(
xblock_info
[
'highlights_enabled'
])
self
.
assertFalse
(
xblock_info
[
'highlights_enabled_for_messaging'
])
# Finally, validate the entire response for consistency
# Finally, validate the entire response for consistency
self
.
validate_xblock_info_consistency
(
xblock_info
,
has_child_info
=
has_child_info
)
self
.
validate_xblock_info_consistency
(
xblock_info
,
has_child_info
=
has_child_info
)
...
...
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