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
f7e78544
Commit
f7e78544
authored
Feb 12, 2014
by
zubiar-arbi
Committed by
Calen Pennington
Feb 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
failing test for xblock_handler
STUD-1311
parent
9b0c8d26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
cms/djangoapps/contentstore/tests/test_item.py
+35
-0
No files found.
cms/djangoapps/contentstore/tests/test_item.py
View file @
f7e78544
...
@@ -538,6 +538,41 @@ class TestEditItem(ItemTest):
...
@@ -538,6 +538,41 @@ class TestEditItem(ItemTest):
draft
=
self
.
get_item_from_modulestore
(
self
.
problem_locator
,
True
)
draft
=
self
.
get_item_from_modulestore
(
self
.
problem_locator
,
True
)
self
.
assertEqual
(
draft
.
due
,
datetime
(
2077
,
10
,
10
,
4
,
0
,
tzinfo
=
UTC
))
self
.
assertEqual
(
draft
.
due
,
datetime
(
2077
,
10
,
10
,
4
,
0
,
tzinfo
=
UTC
))
def
test_published_and_draft_contents_with_update
(
self
):
""" Create a draft and publish it then modify the draft and check that published content is not modified """
# Make problem public.
resp
=
self
.
client
.
ajax_post
(
self
.
problem_update_url
,
data
=
{
'publish'
:
'make_public'
}
)
self
.
assertIsNotNone
(
self
.
get_item_from_modulestore
(
self
.
problem_locator
,
False
))
# Now make a draft
resp
=
self
.
client
.
ajax_post
(
self
.
problem_update_url
,
data
=
{
'id'
:
self
.
problem_locator
,
'metadata'
:
{},
'data'
:
"<p>Problem content draft.</p>"
,
'publish'
:
'create_draft'
}
)
# Both published and draft content should be different
published
=
self
.
get_item_from_modulestore
(
self
.
problem_locator
,
False
)
draft
=
self
.
get_item_from_modulestore
(
self
.
problem_locator
,
True
)
self
.
assertNotEqual
(
draft
.
data
,
published
.
data
)
# Get problem by 'xblock_handler'
resp
=
self
.
client
.
get
(
'/xblock/'
+
self
.
problem_locator
,
HTTP_ACCEPT
=
'application/x-fragment+json'
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
# Both published and draft content should still be different
published
=
self
.
get_item_from_modulestore
(
self
.
problem_locator
,
False
)
draft
=
self
.
get_item_from_modulestore
(
self
.
problem_locator
,
True
)
self
.
assertNotEqual
(
draft
.
data
,
published
.
data
)
@ddt.ddt
@ddt.ddt
class
TestComponentHandler
(
TestCase
):
class
TestComponentHandler
(
TestCase
):
...
...
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