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
62a70170
Commit
62a70170
authored
Jan 09, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated unit test for the create operation related to bug 107
parent
2019c9d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
cms/djangoapps/contentstore/tests/test_course_updates.py
+8
-7
No files found.
cms/djangoapps/contentstore/tests/test_course_updates.py
View file @
62a70170
from
cms.djangoapps.contentstore.tests.test_course_settings
import
CourseTestCase
from
django.core.urlresolvers
import
reverse
import
json
from
cms.djangoapps.contentstore.course_info_model
import
update_course_updates
class
CourseUpdateTest
(
CourseTestCase
):
def
test_course_update
(
self
):
...
...
@@ -14,14 +12,17 @@ class CourseUpdateTest(CourseTestCase):
content
=
'<iframe width="560" height="315" src="http://www.youtube.com/embed/RocY-Jd93XU" frameborder="0"></iframe>'
payload
=
{
'content'
:
content
,
'date'
:
'January 8, 2013'
}
# No means to post w/ provided_id missing. django doesn't handle. So, go direct for the create
payload
=
update_course_updates
([
'i4x'
,
self
.
course_location
.
org
,
self
.
course_location
.
course
,
'course_info'
,
"updates"
]
,
payload
)
url
=
reverse
(
'course_info'
,
kwargs
=
{
'org'
:
self
.
course_location
.
org
,
'course'
:
self
.
course_location
.
course
,
'provided_id'
:
payload
[
'id'
]})
'provided_id'
:
''
})
resp
=
self
.
client
.
post
(
url
,
json
.
dumps
(
payload
),
"application/json"
)
payload
=
json
.
loads
(
resp
.
content
)
self
.
assertHTMLEqual
(
content
,
payload
[
'content'
],
"single iframe"
)
url
=
reverse
(
'course_info'
,
kwargs
=
{
'org'
:
self
.
course_location
.
org
,
'course'
:
self
.
course_location
.
course
,
'provided_id'
:
payload
[
'id'
]})
content
+=
'<div>div <p>p</p></div>'
payload
[
'content'
]
=
content
resp
=
self
.
client
.
post
(
url
,
json
.
dumps
(
payload
),
"application/json"
)
...
...
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