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
5298f54f
Commit
5298f54f
authored
Jul 25, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests
parent
cff93d32
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
15 deletions
+14
-15
cms/djangoapps/contentstore/module_info_model.py
+1
-8
common/djangoapps/static_replace/test/test_static_replace.py
+4
-5
lms/djangoapps/courseware/tests/test_video_mongo.py
+8
-1
lms/djangoapps/staticbook/views.py
+1
-1
No files found.
cms/djangoapps/contentstore/module_info_model.py
View file @
5298f54f
from
static_replace
import
replace_static_urls
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.modulestore
import
Location
def
get_module_info
(
store
,
location
,
rewrite_static_links
=
False
):
...
...
@@ -16,13 +15,7 @@ def get_module_info(store, location, rewrite_static_links=False):
data
=
replace_static_urls
(
module
.
data
,
None
,
course_namespace
=
Location
([
module
.
location
.
tag
,
module
.
location
.
org
,
module
.
location
.
course
,
None
,
None
])
course_id
=
module
.
location
.
org
+
'/'
+
module
.
location
.
course
+
'/REPLACE_WITH_RUN_WHEN_IMPLEMENTED'
)
return
{
...
...
common/djangoapps/static_replace/test/test_static_replace.py
View file @
5298f54f
...
...
@@ -10,7 +10,6 @@ from xmodule.modulestore.xml import XMLModuleStore
DATA_DIRECTORY
=
'data_dir'
COURSE_ID
=
'org/course/run'
NAMESPACE
=
Location
(
'org'
,
'course'
,
'run'
,
None
,
None
)
STATIC_SOURCE
=
'"/static/file.png"'
...
...
@@ -52,18 +51,18 @@ def test_storage_url_not_exists(mock_storage):
def
test_mongo_filestore
(
mock_modulestore
,
mock_static_content
):
mock_modulestore
.
return_value
=
Mock
(
MongoModuleStore
)
mock_static_content
.
convert_legacy_static_url
.
return_value
=
"c4x://mock_url"
mock_static_content
.
convert_legacy_static_url
_with_course_id
.
return_value
=
"c4x://mock_url"
# No namespace => no change to path
assert_equals
(
'"/static/data_dir/file.png"'
,
replace_static_urls
(
STATIC_SOURCE
,
DATA_DIRECTORY
))
# Namespace => content url
assert_equals
(
'"'
+
mock_static_content
.
convert_legacy_static_url
.
return_value
+
'"'
,
replace_static_urls
(
STATIC_SOURCE
,
DATA_DIRECTORY
,
NAMESPACE
)
'"'
+
mock_static_content
.
convert_legacy_static_url
_with_course_id
.
return_value
+
'"'
,
replace_static_urls
(
STATIC_SOURCE
,
DATA_DIRECTORY
,
course_id
=
COURSE_ID
)
)
mock_static_content
.
convert_legacy_static_url
.
assert_called_once_with
(
'file.png'
,
NAMESPACE
)
mock_static_content
.
convert_legacy_static_url
_with_course_id
.
assert_called_once_with
(
'file.png'
,
COURSE_ID
)
@patch
(
'static_replace.settings'
)
...
...
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
5298f54f
...
...
@@ -54,7 +54,7 @@ class TestVideo(BaseTestXmodule):
expected_context
=
{
'data_dir'
:
getattr
(
self
,
'data_dir'
,
None
),
'caption_asset_path'
:
'/
c4x/MITx/999/asset/subs_
'
,
'caption_asset_path'
:
'/
static/subs/
'
,
'show_captions'
:
'true'
,
'display_name'
:
'A Name'
,
'end'
:
3610.0
,
...
...
@@ -104,10 +104,17 @@ class TestVideoNonYouTube(TestVideo):
expected_context
=
{
'data_dir'
:
getattr
(
self
,
'data_dir'
,
None
),
<<<<<<<
HEAD
'caption_asset_path'
:
'/c4x/MITx/999/asset/subs_'
,
'show_captions'
:
'true'
,
'display_name'
:
'A Name'
,
'end'
:
3610.0
,
=======
'caption_asset_path'
:
'/static/subs/'
,
'show_captions'
:
self
.
item_module
.
show_captions
,
'display_name'
:
self
.
item_module
.
display_name_with_default
,
'end'
:
self
.
item_module
.
end_time
,
>>>>>>>
fix
tests
'id'
:
self
.
item_module
.
location
.
html_id
(),
'sources'
:
sources
,
'start'
:
3603.0
,
...
...
lms/djangoapps/staticbook/views.py
View file @
5298f54f
...
...
@@ -50,7 +50,7 @@ def remap_static_url(original_url, course):
output_url
=
replace_static_urls
(
input_url
,
getattr
(
course
,
'data_dir'
,
None
),
cour
es
_id
=
course
.
location
.
course_id
,
cour
se
_id
=
course
.
location
.
course_id
,
)
# strip off the quotes again...
return
output_url
[
1
:
-
1
]
...
...
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