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
861f1ef7
Commit
861f1ef7
authored
Jul 31, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a test for the static url generation
parent
b8bc1d01
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
cms/djangoapps/contentstore/tests/test_assets.py
+7
-0
No files found.
cms/djangoapps/contentstore/tests/test_assets.py
View file @
861f1ef7
...
@@ -10,6 +10,8 @@ from unittest import TestCase, skip
...
@@ -10,6 +10,8 @@ from unittest import TestCase, skip
from
.utils
import
CourseTestCase
from
.utils
import
CourseTestCase
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
contentstore.views
import
assets
from
contentstore.views
import
assets
from
xmodule.contentstore.content
import
StaticContent
from
xmodule.modulestore
import
Location
class
AssetsTestCase
(
CourseTestCase
):
class
AssetsTestCase
(
CourseTestCase
):
...
@@ -35,6 +37,11 @@ class AssetsTestCase(CourseTestCase):
...
@@ -35,6 +37,11 @@ class AssetsTestCase(CourseTestCase):
content
=
json
.
loads
(
resp
.
content
)
content
=
json
.
loads
(
resp
.
content
)
self
.
assertIsInstance
(
content
,
list
)
self
.
assertIsInstance
(
content
,
list
)
def
test_static_url_generation
(
self
):
location
=
Location
([
'i4x'
,
'foo'
,
'bar'
,
'asset'
,
'my_file_name.jpg'
])
path
=
StaticContent
.
get_static_path_from_location
(
location
)
self
.
assertEquals
(
path
,
'/static/my_file_name.jpg'
)
class
UploadTestCase
(
CourseTestCase
):
class
UploadTestCase
(
CourseTestCase
):
"""
"""
...
...
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