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
ca2fee12
Commit
ca2fee12
authored
Apr 21, 2015
by
David Baumgold
Committed by
Sarina Canelake
May 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move LicenseMixin into VideoFields class
parent
2159d341
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
2 deletions
+98
-2
common/lib/xmodule/xmodule/video_module/video_module.py
+1
-1
common/lib/xmodule/xmodule/video_module/video_xfields.py
+2
-1
common/test/acceptance/pages/studio/container.py
+10
-0
common/test/acceptance/tests/video/test_video_license.py
+85
-0
No files found.
common/lib/xmodule/xmodule/video_module/video_module.py
View file @
ca2fee12
...
...
@@ -288,7 +288,7 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers,
class
VideoDescriptor
(
VideoFields
,
VideoTranscriptsMixin
,
VideoStudioViewHandlers
,
TabsEditingDescriptor
,
LicenseMixin
,
EmptyDataRawDescriptor
):
TabsEditingDescriptor
,
EmptyDataRawDescriptor
):
"""
Descriptor for `VideoModule`.
"""
...
...
common/lib/xmodule/xmodule/video_module/video_xfields.py
View file @
ca2fee12
...
...
@@ -6,12 +6,13 @@ import datetime
from
xblock.fields
import
Scope
,
String
,
Float
,
Boolean
,
List
,
Dict
from
xmodule.fields
import
RelativeTime
from
xmodule.mixin
import
LicenseMixin
# Make '_' a no-op so we can scrape strings
_
=
lambda
text
:
text
class
VideoFields
(
object
):
class
VideoFields
(
LicenseMixin
):
"""Fields for `VideoModule` and `VideoDescriptor`."""
display_name
=
String
(
help
=
_
(
"The name students see. This name appears in the course ribbon and as a header for the video."
),
...
...
common/test/acceptance/pages/studio/container.py
View file @
ca2fee12
...
...
@@ -487,6 +487,16 @@ class XBlockWrapper(PageObject):
"""
type_in_codemirror
(
self
,
index
,
text
,
find_prefix
=
'$("{}").find'
.
format
(
self
.
editor_selector
))
def
set_license
(
self
,
license_type
):
css_selector
=
(
"ul.license-types li[data-license={license_type}] button"
)
.
format
(
license_type
=
license_type
)
self
.
wait_for_element_presence
(
css_selector
,
"{license_type} button is present"
.
format
(
license_type
=
license_type
)
)
self
.
q
(
css
=
css_selector
)
.
click
()
def
save_settings
(
self
):
"""
Click on settings Save button.
...
...
common/test/acceptance/tests/video/test_video_license.py
0 → 100644
View file @
ca2fee12
# coding: utf-8
from
__future__
import
unicode_literals
from
nose.plugins.attrib
import
attr
from
..studio.base_studio_test
import
StudioCourseTest
#from ..helpers import UniqueCourseTest
from
...pages.studio.overview
import
CourseOutlinePage
from
...pages.lms.courseware
import
CoursewarePage
from
...fixtures.course
import
XBlockFixtureDesc
@attr
(
'shard_1'
)
class
VideoLicenseTest
(
StudioCourseTest
):
def
setUp
(
self
):
super
(
VideoLicenseTest
,
self
)
.
setUp
()
self
.
lms_courseware
=
CoursewarePage
(
self
.
browser
,
self
.
course_id
,
)
self
.
studio_course_outline
=
CourseOutlinePage
(
self
.
browser
,
self
.
course_info
[
'org'
],
self
.
course_info
[
'number'
],
self
.
course_info
[
'run'
]
)
# used by StudioCourseTest.setUp()
def
populate_course_fixture
(
self
,
course_fixture
):
video_block
=
XBlockFixtureDesc
(
'video'
,
"Test Video"
)
vertical
=
XBlockFixtureDesc
(
'vertical'
,
"Test Vertical"
)
vertical
.
add_children
(
video_block
)
sequential
=
XBlockFixtureDesc
(
'sequential'
,
"Test Section"
)
sequential
.
add_children
(
vertical
)
chapter
=
XBlockFixtureDesc
(
'chapter'
,
"Test Chapter"
)
chapter
.
add_children
(
sequential
)
self
.
course_fixture
.
add_children
(
chapter
)
def
test_empty_license
(
self
):
self
.
lms_courseware
.
visit
()
video
=
self
.
lms_courseware
.
q
(
css
=
".vert .xblock .video"
)
self
.
assertTrue
(
video
.
is_present
())
video_license
=
self
.
lms_courseware
.
q
(
css
=
".vert .xblock.xmodule_VideoModule .xblock-license"
)
self
.
assertFalse
(
video_license
.
is_present
())
def
test_arr_license
(
self
):
self
.
studio_course_outline
.
visit
()
subsection
=
self
.
studio_course_outline
.
section_at
(
0
)
.
subsection_at
(
0
)
subsection
.
expand_subsection
()
unit
=
subsection
.
unit_at
(
0
)
container_page
=
unit
.
go_to
()
container_page
.
edit
()
video
=
[
xb
for
xb
in
container_page
.
xblocks
if
xb
.
name
==
"Test Video"
][
0
]
video
.
edit
()
.
open_advanced_tab
()
video
.
set_license
(
'all-rights-reserved'
)
video
.
save_settings
()
container_page
.
publish_action
.
click
()
self
.
lms_courseware
.
visit
()
video
=
self
.
lms_courseware
.
q
(
css
=
".vert .xblock .video"
)
self
.
assertTrue
(
video
.
is_present
())
video_license
=
self
.
lms_courseware
.
q
(
css
=
".vert .xblock.xmodule_VideoModule .xblock-license"
)
self
.
assertTrue
(
video_license
.
is_present
())
self
.
assertEqual
(
video_license
.
text
[
0
],
"© All Rights Reserved"
)
def
test_cc_license
(
self
):
self
.
studio_course_outline
.
visit
()
subsection
=
self
.
studio_course_outline
.
section_at
(
0
)
.
subsection_at
(
0
)
subsection
.
expand_subsection
()
unit
=
subsection
.
unit_at
(
0
)
container_page
=
unit
.
go_to
()
container_page
.
edit
()
video
=
[
xb
for
xb
in
container_page
.
xblocks
if
xb
.
name
==
"Test Video"
][
0
]
video
.
edit
()
.
open_advanced_tab
()
video
.
set_license
(
'creative-commons'
)
video
.
save_settings
()
container_page
.
publish_action
.
click
()
self
.
lms_courseware
.
visit
()
video
=
self
.
lms_courseware
.
q
(
css
=
".vert .xblock .video"
)
self
.
assertTrue
(
video
.
is_present
())
video_license
=
self
.
lms_courseware
.
q
(
css
=
".vert .xblock.xmodule_VideoModule .xblock-license"
)
self
.
assertTrue
(
video_license
.
is_present
())
self
.
assertEqual
(
video_license
.
text
[
0
],
"Some Rights Reserved"
)
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