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
68ba1786
Commit
68ba1786
authored
Mar 27, 2015
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7496 from open-craft/studio-display-name-consistency
Consistently use display_name_with_default in Studio
parents
33361a05
19bd7005
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletions
+37
-1
cms/templates/studio_xblock_wrapper.html
+1
-1
common/test/acceptance/tests/studio/test_studio_container.py
+36
-0
No files found.
cms/templates/studio_xblock_wrapper.html
View file @
68ba1786
...
...
@@ -9,7 +9,7 @@ xblock_url = xblock_studio_url(xblock)
show_inline =
xblock.has_children
and
not
xblock_url
section_class =
"level-nesting"
if
show_inline
else
"
level-element
"
collapsible_class =
"is-collapsible"
if
xblock
.
has_children
else
""
label =
xblock.display_name
or
xblock
.
scope_ids
.
block_type
label =
xblock.display_name
_with_default
or
xblock
.
scope_ids
.
block_type
messages =
json.dumps(xblock.validate().to_json())
%
>
...
...
common/test/acceptance/tests/studio/test_studio_container.py
View file @
68ba1786
...
...
@@ -1020,3 +1020,39 @@ class UnitPublishingTest(ContainerBase):
# self.assertEqual(2, self.courseware.num_xblock_components)
# self.assertEqual('html', self.courseware.xblock_component_type(0))
# self.assertEqual('discussion', self.courseware.xblock_component_type(1))
class
DisplayNameTest
(
ContainerBase
):
"""
Test consistent use of display_name_with_default
"""
def
populate_course_fixture
(
self
,
course_fixture
):
"""
Sets up a course structure with nested verticals.
"""
course_fixture
.
add_children
(
XBlockFixtureDesc
(
'chapter'
,
'Test Section'
)
.
add_children
(
XBlockFixtureDesc
(
'sequential'
,
'Test Subsection'
)
.
add_children
(
XBlockFixtureDesc
(
'vertical'
,
'Test Unit'
)
.
add_children
(
XBlockFixtureDesc
(
'vertical'
,
None
)
)
)
)
)
def
test_display_name_default
(
self
):
"""
Scenario: Given that an XBlock with a dynamic display name has been added to the course,
When I view the unit page and note the display name of the block,
Then I see the dynamically generated display name,
And when I then go to the container page for that same block,
Then I see the same generated display name.
"""
# Unfortunately no blocks in the core platform implement display_name_with_default
# in an interesting way for this test, so we are just testing for consistency and not
# the actual value.
unit
=
self
.
go_to_unit_page
()
test_block
=
unit
.
xblocks
[
1
]
title_on_unit_page
=
test_block
.
name
container
=
test_block
.
go_to_container
()
self
.
assertEqual
(
container
.
name
,
title_on_unit_page
)
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