Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
5137119f
Commit
5137119f
authored
11 years ago
by
Chris Dodge
Browse files
Options
Downloads
Patches
Plain Diff
add a simple Studio walkthough to check page loads
parent
c6bec6bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/djangoapps/contentstore/tests/test_contentstore.py
+107
-0
107 additions, 0 deletions
cms/djangoapps/contentstore/tests/test_contentstore.py
common/test/data/simple/course.xml
+3
-3
3 additions, 3 deletions
common/test/data/simple/course.xml
with
110 additions
and
3 deletions
cms/djangoapps/contentstore/tests/test_contentstore.py
+
107
−
0
View file @
5137119f
...
...
@@ -628,6 +628,113 @@ class ContentStoreTest(ModuleStoreTestCase):
self
.
assertIn
(
'
markdown
'
,
context
,
"
markdown is missing from context
"
)
self
.
assertNotIn
(
'
markdown
'
,
problem
.
editable_metadata_fields
,
"
Markdown slipped into the editable metadata fields
"
)
def
test_cms_imported_course_walkthrough
(
self
):
"""
Import and walk through some common URL endpoints. This just verifies non-500 and no other
correct behavior, so it is not a deep test
"""
import_from_xml
(
modulestore
(),
'
common/test/data/
'
,
[
'
simple
'
])
loc
=
Location
([
'
i4x
'
,
'
edX
'
,
'
simple
'
,
'
course
'
,
'
2012_Fall
'
,
None
])
resp
=
self
.
client
.
get
(
reverse
(
'
course_index
'
,
kwargs
=
{
'
org
'
:
loc
.
org
,
'
course
'
:
loc
.
course
,
'
name
'
:
loc
.
name
}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
self
.
assertContains
(
resp
,
'
Chapter 2
'
)
# go to various pages
# import page
resp
=
self
.
client
.
get
(
reverse
(
'
import_course
'
,
kwargs
=
{
'
org
'
:
loc
.
org
,
'
course
'
:
loc
.
course
,
'
name
'
:
loc
.
name
}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# export page
resp
=
self
.
client
.
get
(
reverse
(
'
export_course
'
,
kwargs
=
{
'
org
'
:
loc
.
org
,
'
course
'
:
loc
.
course
,
'
name
'
:
loc
.
name
}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# manage users
resp
=
self
.
client
.
get
(
reverse
(
'
manage_users
'
,
kwargs
=
{
'
location
'
:
loc
.
url
()}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# course info
resp
=
self
.
client
.
get
(
reverse
(
'
course_info
'
,
kwargs
=
{
'
org
'
:
loc
.
org
,
'
course
'
:
loc
.
course
,
'
name
'
:
loc
.
name
}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# settings_details
resp
=
self
.
client
.
get
(
reverse
(
'
settings_details
'
,
kwargs
=
{
'
org
'
:
loc
.
org
,
'
course
'
:
loc
.
course
,
'
name
'
:
loc
.
name
}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# settings_details
resp
=
self
.
client
.
get
(
reverse
(
'
settings_grading
'
,
kwargs
=
{
'
org
'
:
loc
.
org
,
'
course
'
:
loc
.
course
,
'
name
'
:
loc
.
name
}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# static_pages
resp
=
self
.
client
.
get
(
reverse
(
'
static_pages
'
,
kwargs
=
{
'
org
'
:
loc
.
org
,
'
course
'
:
loc
.
course
,
'
coursename
'
:
loc
.
name
}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# static_pages
resp
=
self
.
client
.
get
(
reverse
(
'
asset_index
'
,
kwargs
=
{
'
org
'
:
loc
.
org
,
'
course
'
:
loc
.
course
,
'
name
'
:
loc
.
name
}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# go look at a subsection page
subsection_location
=
loc
.
_replace
(
category
=
'
sequential
'
,
name
=
'
test_sequence
'
)
resp
=
self
.
client
.
get
(
reverse
(
'
edit_subsection
'
,
kwargs
=
{
'
location
'
:
subsection_location
.
url
()}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# go look at the Edit page
unit_location
=
loc
.
_replace
(
category
=
'
vertical
'
,
name
=
'
test_vertical
'
)
resp
=
self
.
client
.
get
(
reverse
(
'
edit_unit
'
,
kwargs
=
{
'
location
'
:
unit_location
.
url
()}))
self
.
assertEqual
(
200
,
resp
.
status_code
)
# delete a component
del_loc
=
loc
.
_replace
(
category
=
'
html
'
,
name
=
'
test_html
'
)
resp
=
self
.
client
.
post
(
reverse
(
'
delete_item
'
),
json
.
dumps
({
'
id
'
:
del_loc
.
url
()}),
"
application/json
"
)
self
.
assertEqual
(
200
,
resp
.
status_code
)
# delete a unit
del_loc
=
loc
.
_replace
(
category
=
'
vertical
'
,
name
=
'
test_vertical
'
)
resp
=
self
.
client
.
post
(
reverse
(
'
delete_item
'
),
json
.
dumps
({
'
id
'
:
del_loc
.
url
()}),
"
application/json
"
)
self
.
assertEqual
(
200
,
resp
.
status_code
)
# delete a unit
del_loc
=
loc
.
_replace
(
category
=
'
sequential
'
,
name
=
'
test_sequence
'
)
resp
=
self
.
client
.
post
(
reverse
(
'
delete_item
'
),
json
.
dumps
({
'
id
'
:
del_loc
.
url
()}),
"
application/json
"
)
self
.
assertEqual
(
200
,
resp
.
status_code
)
# delete a chapter
del_loc
=
loc
.
_replace
(
category
=
'
chapter
'
,
name
=
'
chapter_2
'
)
resp
=
self
.
client
.
post
(
reverse
(
'
delete_item
'
),
json
.
dumps
({
'
id
'
:
del_loc
.
url
()}),
"
application/json
"
)
self
.
assertEqual
(
200
,
resp
.
status_code
)
def
test_import_metadata_with_attempts_empty_string
(
self
):
import_from_xml
(
modulestore
(),
'
common/test/data/
'
,
[
'
simple
'
])
module_store
=
modulestore
(
'
direct
'
)
...
...
This diff is collapsed.
Click to expand it.
common/test/data/simple/course.xml
+
3
−
3
View file @
5137119f
...
...
@@ -12,15 +12,15 @@
</sequential>
</section>
</chapter>
<chapter
name=
"Chapter 2"
>
<chapter
name=
"Chapter 2"
url_name=
'chapter_2'
>
<section
name=
"Problem Set 1"
>
<sequential>
<problem
type=
"lecture"
showanswer=
"attempted"
rerandomize=
"true"
display_name=
"A simple coding problem"
name=
"Simple coding problem"
filename=
"ps01-simple"
url_name=
"ps01-simple"
/>
</sequential>
</section>
<video
name=
"Lost Video"
youtube=
"1.0:TBvX7HzxexQ"
/>
<sequential
format=
"Lecture Sequence"
>
<vertical
url_name=
'test_verical'
>
<sequential
format=
"Lecture Sequence"
url_name=
'test_sequence'
>
<vertical
url_name=
'test_ver
t
ical'
>
<html
url_name=
'test_html'
>
Foobar
</html>
...
...
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