Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
19bd7005
Commit
19bd7005
authored
10 years ago
by
Braden MacDonald
Browse files
Options
Downloads
Patches
Plain Diff
Consistently use display_name_with_default in Studio
parent
5615f0bf
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/templates/studio_xblock_wrapper.html
+1
-1
1 addition, 1 deletion
cms/templates/studio_xblock_wrapper.html
common/test/acceptance/tests/studio/test_studio_container.py
+36
-0
36 additions, 0 deletions
common/test/acceptance/tests/studio/test_studio_container.py
with
37 additions
and
1 deletion
cms/templates/studio_xblock_wrapper.html
+
1
−
1
View file @
19bd7005
...
...
@@ -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())
%
>
...
...
This diff is collapsed.
Click to expand it.
common/test/acceptance/tests/studio/test_studio_container.py
+
36
−
0
View file @
19bd7005
...
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment