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
2ae3fd0a
Commit
2ae3fd0a
authored
Oct 17, 2014
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5589 from edx/christina/tnl-399-remove-save
Do not save an xblock after rendering the Studio view.
parents
d1f256af
d3012af7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
7 deletions
+36
-7
cms/djangoapps/contentstore/views/item.py
+0
-1
common/test/acceptance/pages/studio/html_component_editor.py
+15
-4
common/test/acceptance/tests/studio/test_studio_acid_xblock.py
+0
-2
common/test/acceptance/tests/studio/test_studio_container.py
+21
-0
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
2ae3fd0a
...
...
@@ -225,7 +225,6 @@ def xblock_view_handler(request, usage_key_string, view_name):
log
.
debug
(
"unable to render studio_view for
%
r"
,
xblock
,
exc_info
=
True
)
fragment
=
Fragment
(
render_to_string
(
'html_error.html'
,
{
'message'
:
str
(
exc
)}))
store
.
update_item
(
xblock
,
request
.
user
.
id
)
elif
view_name
in
(
PREVIEW_VIEWS
+
container_views
):
is_pages_view
=
view_name
==
STUDENT_VIEW
# Only the "Pages" view uses student view in Studio
...
...
common/test/acceptance/pages/studio/html_component_editor.py
View file @
2ae3fd0a
from
selenium.webdriver.common.keys
import
Keys
from
selenium.webdriver.common.action_chains
import
ActionChains
from
utils
import
click_css
from
component_editor
import
ComponentEditorView
...
...
@@ -8,13 +7,25 @@ class HtmlComponentEditorView(ComponentEditorView):
"""
Represents the rendered view of an HTML component editor.
"""
def
set_content_and_save
(
self
,
content
):
"""
Types content into the html component.
Types content into the html component and presses Save.
"""
self
.
set_content
(
content
)
self
.
save
()
def
set_content_and_cancel
(
self
,
content
):
"""
Types content into the html component and presses Cancel to abort the change.
"""
self
.
set_content
(
content
)
self
.
cancel
()
def
set_content
(
self
,
content
):
"""
Types content into the html component, leaving the component open.
"""
self
.
q
(
css
=
'.edit-xblock-modal .editor-modes .editor-button'
)
.
click
()
editor
=
self
.
q
(
css
=
self
.
_bounded_selector
(
'.html-editor .mce-edit-area'
))[
0
]
ActionChains
(
self
.
browser
)
.
click
(
editor
)
.
\
send_keys
([
Keys
.
CONTROL
,
'a'
])
.
key_up
(
Keys
.
CONTROL
)
.
send_keys
(
content
)
.
perform
()
click_css
(
self
,
'a.action-save'
)
common/test/acceptance/tests/studio/test_studio_acid_xblock.py
View file @
2ae3fd0a
...
...
@@ -86,8 +86,6 @@ class XBlockAcidBase(WebAppTest):
acid_block
=
AcidView
(
self
.
browser
,
unit
.
xblocks
[
0
]
.
edit
()
.
editor_selector
)
self
.
assertTrue
(
acid_block
.
init_fn_passed
)
self
.
assertTrue
(
acid_block
.
resource_url_passed
)
self
.
assertTrue
(
acid_block
.
scope_passed
(
'content'
))
self
.
assertTrue
(
acid_block
.
scope_passed
(
'settings'
))
class
XBlockAcidNoChildTest
(
XBlockAcidBase
):
...
...
common/test/acceptance/tests/studio/test_studio_container.py
View file @
2ae3fd0a
...
...
@@ -605,6 +605,27 @@ class UnitPublishingTest(ContainerBase):
self
.
_view_published_version
(
unit
)
self
.
assertTrue
(
modified_content
in
self
.
courseware
.
xblock_component_html_content
(
0
))
def
test_cancel_does_not_create_draft
(
self
):
"""
Scenario: Editing a component and then canceling does not create a draft version (TNL-399)
Given I have a published unit with no unpublished changes
When I go to the unit page in Studio
And edit the content of an HTML component and then press cancel
Then the content does not change
And the title in the Publish information box is "Published and Live"
And when I reload the page
Then the title in the Publish information box is "Published and Live"
"""
unit
=
self
.
go_to_unit_page
()
component
=
unit
.
xblocks
[
1
]
component
.
edit
()
HtmlComponentEditorView
(
self
.
browser
,
component
.
locator
)
.
set_content_and_cancel
(
"modified content"
)
self
.
assertEqual
(
component
.
student_content
,
"Body of HTML Unit."
)
self
.
_verify_publish_title
(
unit
,
self
.
PUBLISHED_LIVE_STATUS
)
self
.
browser
.
refresh
()
unit
.
wait_for_page
()
self
.
_verify_publish_title
(
unit
,
self
.
PUBLISHED_LIVE_STATUS
)
def
test_delete_child_in_published_unit
(
self
):
"""
Scenario: A published unit can be published again after deleting a child
...
...
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