summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests/test_static.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-12-07 09:43:10 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-12-28 16:23:01 +0100
commit92a2d049a253fb499db88efb6cf6c9209f6f251c (patch)
treebd3c913883b36f918f3c8ae7af942a8c8f50a23f /tests/template_tests/syntax_tests/test_static.py
parentb34b8a12b7f657f379c9e0e5ee7688bf36e242d2 (diff)
Isolated template tests from Django settings.
Diffstat (limited to 'tests/template_tests/syntax_tests/test_static.py')
-rw-r--r--tests/template_tests/syntax_tests/test_static.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/template_tests/syntax_tests/test_static.py b/tests/template_tests/syntax_tests/test_static.py
index 95ddb196af..19b4e53cde 100644
--- a/tests/template_tests/syntax_tests/test_static.py
+++ b/tests/template_tests/syntax_tests/test_static.py
@@ -2,7 +2,7 @@ from django.conf import settings
from django.test import override_settings, SimpleTestCase
from django.utils.six.moves.urllib.parse import urljoin
-from ..utils import render, setup
+from ..utils import setup
@override_settings(MEDIA_URL="/media/", STATIC_URL="/static/")
@@ -10,42 +10,42 @@ class StaticTagTests(SimpleTestCase):
@setup({'static-prefixtag01': '{% load static %}{% get_static_prefix %}'})
def test_static_prefixtag01(self):
- output = render('static-prefixtag01')
+ output = self.engine.render_to_string('static-prefixtag01')
self.assertEqual(output, settings.STATIC_URL)
@setup({'static-prefixtag02': '{% load static %}'
'{% get_static_prefix as static_prefix %}{{ static_prefix }}'})
def test_static_prefixtag02(self):
- output = render('static-prefixtag02')
+ output = self.engine.render_to_string('static-prefixtag02')
self.assertEqual(output, settings.STATIC_URL)
@setup({'static-prefixtag03': '{% load static %}{% get_media_prefix %}'})
def test_static_prefixtag03(self):
- output = render('static-prefixtag03')
+ output = self.engine.render_to_string('static-prefixtag03')
self.assertEqual(output, settings.MEDIA_URL)
@setup({'static-prefixtag04': '{% load static %}'
'{% get_media_prefix as media_prefix %}{{ media_prefix }}'})
def test_static_prefixtag04(self):
- output = render('static-prefixtag04')
+ output = self.engine.render_to_string('static-prefixtag04')
self.assertEqual(output, settings.MEDIA_URL)
@setup({'static-statictag01': '{% load static %}{% static "admin/base.css" %}'})
def test_static_statictag01(self):
- output = render('static-statictag01')
+ output = self.engine.render_to_string('static-statictag01')
self.assertEqual(output, urljoin(settings.STATIC_URL, 'admin/base.css'))
@setup({'static-statictag02': '{% load static %}{% static base_css %}'})
def test_static_statictag02(self):
- output = render('static-statictag02', {'base_css': 'admin/base.css'})
+ output = self.engine.render_to_string('static-statictag02', {'base_css': 'admin/base.css'})
self.assertEqual(output, urljoin(settings.STATIC_URL, 'admin/base.css'))
@setup({'static-statictag03': '{% load static %}{% static "admin/base.css" as foo %}{{ foo }}'})
def test_static_statictag03(self):
- output = render('static-statictag03')
+ output = self.engine.render_to_string('static-statictag03')
self.assertEqual(output, urljoin(settings.STATIC_URL, 'admin/base.css'))
@setup({'static-statictag04': '{% load static %}{% static base_css as foo %}{{ foo }}'})
def test_static_statictag04(self):
- output = render('static-statictag04', {'base_css': 'admin/base.css'})
+ output = self.engine.render_to_string('static-statictag04', {'base_css': 'admin/base.css'})
self.assertEqual(output, urljoin(settings.STATIC_URL, 'admin/base.css'))