Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
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
OpenEdx
django-pipeline
Commits
ba7b8d0d
Commit
ba7b8d0d
authored
Oct 29, 2014
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
9e689655
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
docs/configuration.rst
+1
-1
tests/tests/test_template.py
+8
-8
No files found.
docs/configuration.rst
View file @
ba7b8d0d
...
...
@@ -185,7 +185,7 @@ Other settings
(
(b'text/coffeescript', '.coffee'),
(b'text/less', '.less'),
(b'
application
/javascript', '.js'),
(b'
text
/javascript', '.js'),
(b'text/x-sass', '.sass'),
(b'text/x-scss', '.scss')
)
...
...
tests/tests/test_template.py
View file @
ba7b8d0d
...
...
@@ -35,19 +35,19 @@ class JinjaTest(TestCase):
def
test_package_js
(
self
):
template
=
self
.
env
.
from_string
(
u"""{
%
compressed_js "scripts"
%
}"""
)
self
.
assertEqual
(
u'<script type="
application
/javascript" src="/static/scripts.js" charset="utf-8"></script>'
,
template
.
render
())
self
.
assertEqual
(
u'<script type="
text
/javascript" src="/static/scripts.js" charset="utf-8"></script>'
,
template
.
render
())
def
test_package_js_async
(
self
):
template
=
self
.
env
.
from_string
(
u"""{
%
compressed_js "scripts_async"
%
}"""
)
self
.
assertEqual
(
u'<script async type="
application
/javascript" src="/static/scripts_async.js" charset="utf-8"></script>'
,
template
.
render
())
self
.
assertEqual
(
u'<script async type="
text
/javascript" src="/static/scripts_async.js" charset="utf-8"></script>'
,
template
.
render
())
def
test_package_js_defer
(
self
):
template
=
self
.
env
.
from_string
(
u"""{
%
compressed_js "scripts_defer"
%
}"""
)
self
.
assertEqual
(
u'<script defer type="
application
/javascript" src="/static/scripts_defer.js" charset="utf-8"></script>'
,
template
.
render
())
self
.
assertEqual
(
u'<script defer type="
text
/javascript" src="/static/scripts_defer.js" charset="utf-8"></script>'
,
template
.
render
())
def
test_package_js_async_defer
(
self
):
template
=
self
.
env
.
from_string
(
u"""{
%
compressed_js "scripts_async_defer"
%
}"""
)
self
.
assertEqual
(
u'<script async defer type="
application
/javascript" src="/static/scripts_async_defer.js" charset="utf-8"></script>'
,
template
.
render
())
self
.
assertEqual
(
u'<script async defer type="
text
/javascript" src="/static/scripts_async_defer.js" charset="utf-8"></script>'
,
template
.
render
())
class
DjangoTest
(
TestCase
):
...
...
@@ -64,16 +64,16 @@ class DjangoTest(TestCase):
def
test_compressed_js
(
self
):
rendered
=
self
.
render_template
(
u"""{
%
load compressed
%
}{
%
compressed_js "scripts"
%
}"""
)
self
.
assertEqual
(
u'<script type="
application
/javascript" src="/static/scripts.js" charset="utf-8"></script>'
,
rendered
)
self
.
assertEqual
(
u'<script type="
text
/javascript" src="/static/scripts.js" charset="utf-8"></script>'
,
rendered
)
def
test_compressed_js_async
(
self
):
rendered
=
self
.
render_template
(
u"""{
%
load compressed
%
}{
%
compressed_js "scripts_async"
%
}"""
)
self
.
assertEqual
(
u'<script async type="
application
/javascript" src="/static/scripts_async.js" charset="utf-8"></script>'
,
rendered
)
self
.
assertEqual
(
u'<script async type="
text
/javascript" src="/static/scripts_async.js" charset="utf-8"></script>'
,
rendered
)
def
test_compressed_js_defer
(
self
):
rendered
=
self
.
render_template
(
u"""{
%
load compressed
%
}{
%
compressed_js "scripts_defer"
%
}"""
)
self
.
assertEqual
(
u'<script defer type="
application
/javascript" src="/static/scripts_defer.js" charset="utf-8"></script>'
,
rendered
)
self
.
assertEqual
(
u'<script defer type="
text
/javascript" src="/static/scripts_defer.js" charset="utf-8"></script>'
,
rendered
)
def
test_compressed_js_async_defer
(
self
):
rendered
=
self
.
render_template
(
u"""{
%
load compressed
%
}{
%
compressed_js "scripts_async_defer"
%
}"""
)
self
.
assertEqual
(
u'<script async defer type="
application
/javascript" src="/static/scripts_async_defer.js" charset="utf-8"></script>'
,
rendered
)
self
.
assertEqual
(
u'<script async defer type="
text
/javascript" src="/static/scripts_async_defer.js" charset="utf-8"></script>'
,
rendered
)
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