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
e8763ef7
Commit
e8763ef7
authored
Aug 13, 2014
by
Mat Peterson
Committed by
Ben McMorran
Aug 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do TODOs in test_contentstore.py
parent
d695de24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
cms/djangoapps/contentstore/tests/test_contentstore.py
+6
-7
cms/templates/index.html
+3
-3
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
e8763ef7
...
...
@@ -1584,12 +1584,11 @@ class RerunCourseTest(ContentStoreTestCase):
def
create_course_listing_html
(
self
,
course_key
):
"""Creates html fragment that is created for the given course_key in the course listing section"""
return
'
<a class="course-link" href="/course/{}"'
.
format
(
course_key
)
return
'
data-test-course="{}/{}/{}"'
.
format
(
course_key
.
org
,
course_key
.
course
,
course_key
.
run
)
def
create_unsucceeded_course_action_html
(
self
,
course_key
):
"""Creates html fragment that is created for the given course_key in the unsucceeded course action section"""
# TODO Update this once the Rerun UI LMS-11011 is implemented.
return
'<div class="unsucceeded-course-action" href="/course/{}"'
.
format
(
course_key
)
return
'data-test-unsucceeded="{}/{}/{}"'
.
format
(
course_key
.
org
,
course_key
.
course
,
course_key
.
run
)
def
assertInCourseListing
(
self
,
course_key
):
"""
...
...
@@ -1597,7 +1596,7 @@ class RerunCourseTest(ContentStoreTestCase):
and NOT in the unsucceeded course action section of the html.
"""
course_listing_html
=
self
.
client
.
get_html
(
'/course/'
)
self
.
assertIn
(
course_key
.
run
,
course_listing_html
.
content
)
self
.
assertIn
(
self
.
create_course_listing_html
(
course_key
)
,
course_listing_html
.
content
)
self
.
assertNotIn
(
self
.
create_unsucceeded_course_action_html
(
course_key
),
course_listing_html
.
content
)
def
assertInUnsucceededCourseActions
(
self
,
course_key
):
...
...
@@ -1606,8 +1605,8 @@ class RerunCourseTest(ContentStoreTestCase):
and NOT in the accessible course listing section of the html.
"""
course_listing_html
=
self
.
client
.
get_html
(
'/course/'
)
self
.
assertNotIn
(
course_key
.
run
,
course_listing_html
.
content
)
# TODO Verify the course is in the unsucceeded listing once LMS-11011 is implemented.
self
.
assertNotIn
(
self
.
create_course_listing_html
(
course_key
)
,
course_listing_html
.
content
)
self
.
assertIn
(
self
.
create_unsucceeded_course_action_html
(
course_key
),
course_listing_html
.
content
)
def
test_rerun_course_success
(
self
):
...
...
@@ -1650,7 +1649,7 @@ class RerunCourseTest(ContentStoreTestCase):
self
.
assertInCourseListing
(
existent_course_key
)
# Verify that the failed course is NOT in the course listings
self
.
assertInUnsucceededCourseActions
(
non_existent
_course_key
)
self
.
assertInUnsucceededCourseActions
(
destination
_course_key
)
def
test_rerun_course_fail_duplicate_course
(
self
):
existent_course_key
=
CourseFactory
.
create
()
.
id
...
...
cms/templates/index.html
View file @
e8763ef7
...
...
@@ -140,7 +140,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
%for display_name, org, num, run, state_failed, state_in_progress, dismiss_link in sorted(unsucceeded_course_actions, key=lambda s: s[0].lower() if s[0] is not None else ''):
<!-- STATE: re-run is processing -->
%if state_in_progress:
<li
class=
"wrapper-course has-status"
>
<li
class=
"wrapper-course has-status"
data-test-unsucceeded=
"${org}/${num}/${run}"
>
<div
class=
"course-item course-rerun is-processing"
>
<div
class=
"course-details"
href=
"#"
>
<h3
class=
"course-title"
>
${display_name}
</h3>
...
...
@@ -178,7 +178,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
<!-- STATE: re-run has error -->
%if state_failed:
<li
class=
"wrapper-course has-status"
>
<li
class=
"wrapper-course has-status"
data-test-unsucceeded=
"${org}/${num}/${run}"
>
<div
class=
"course-item course-rerun has-error"
>
<div
class=
"course-details"
href=
"#"
>
<h3
class=
"course-title"
>
${display_name}
</h3>
...
...
@@ -229,7 +229,7 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
<div
class=
"courses"
>
<ul
class=
"list-courses"
>
%for course, url, lms_link, rerun_link, org, num, run in sorted(courses, key=lambda s: s[0].lower() if s[0] is not None else ''):
<li
class=
"course-item"
>
<li
class=
"course-item"
data-test-course=
"${org}/${num}/${run}"
>
<a
class=
"course-link"
href=
"${url}"
>
<h3
class=
"course-title"
>
${course}
</h3>
...
...
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