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
88927c74
Commit
88927c74
authored
Apr 21, 2016
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix static tabs test.
parent
84da6e4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
common/lib/xmodule/xmodule/modulestore/tests/factories.py
+0
-1
lms/djangoapps/courseware/tests/test_tabs.py
+3
-5
No files found.
common/lib/xmodule/xmodule/modulestore/tests/factories.py
View file @
88927c74
...
...
@@ -234,7 +234,6 @@ class ToyCourseFactory(SampleCourseFactory):
user_id
,
toy_course
.
id
,
"course_info"
,
"handouts"
,
fields
=
{
"data"
:
"<a href='/static/handouts/sample_handout.txt'>Sample</a>"
}
)
## TODO: Broken! These static tabs are never added to course.tabs?
store
.
create_item
(
user_id
,
toy_course
.
id
,
"static_tab"
,
"resources"
,
fields
=
{
"display_name"
:
"Resources"
},
...
...
lms/djangoapps/courseware/tests/test_tabs.py
View file @
88927c74
...
...
@@ -241,7 +241,6 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
)
cls
.
course
.
tabs
.
append
(
xmodule_tabs
.
CourseTab
.
load
(
'static_tab'
,
name
=
'New Tab'
,
url_slug
=
'new_tab'
))
cls
.
course
.
save
()
cls
.
toy_course_key
=
SlashSeparatedCourseKey
(
'edX'
,
'toy'
,
'2012_Fall'
)
def
test_logged_in
(
self
):
self
.
setup_user
()
...
...
@@ -262,16 +261,15 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
with
self
.
assertRaises
(
Http404
):
static_tab
(
request
,
course_id
=
'edX/toy'
,
tab_slug
=
'new_tab'
)
@skip
(
"Broken! Never finds the 'resources' static tab when created by the ToyCourseFactory."
)
def
test_get_static_tab_contents
(
self
):
self
.
setup_user
()
course
=
get_course_by_id
(
self
.
toy_course_key
)
course
=
get_course_by_id
(
self
.
course
.
id
)
request
=
get_request_for_user
(
self
.
user
)
tab
=
xmodule_tabs
.
CourseTabList
.
get_tab_by_slug
(
course
.
tabs
,
'
resources
'
)
tab
=
xmodule_tabs
.
CourseTabList
.
get_tab_by_slug
(
course
.
tabs
,
'
new_tab
'
)
# Test render works okay
tab_content
=
get_static_tab_contents
(
request
,
course
,
tab
)
self
.
assertIn
(
self
.
toy_course_key
.
to_deprecated_string
(),
tab_content
)
self
.
assertIn
(
self
.
course
.
id
.
to_deprecated_string
(),
tab_content
)
self
.
assertIn
(
'static_tab'
,
tab_content
)
# Test when render raises an exception
...
...
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