summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests/test_numpy.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_numpy.py
parentb34b8a12b7f657f379c9e0e5ee7688bf36e242d2 (diff)
Isolated template tests from Django settings.
Diffstat (limited to 'tests/template_tests/syntax_tests/test_numpy.py')
-rw-r--r--tests/template_tests/syntax_tests/test_numpy.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/template_tests/syntax_tests/test_numpy.py b/tests/template_tests/syntax_tests/test_numpy.py
index 8425d8ecc0..dd6c01f976 100644
--- a/tests/template_tests/syntax_tests/test_numpy.py
+++ b/tests/template_tests/syntax_tests/test_numpy.py
@@ -1,10 +1,9 @@
from unittest import skipIf
import warnings
-from django.conf import settings
from django.test import SimpleTestCase
-from ..utils import render, setup
+from ..utils import setup
try:
import numpy
@@ -28,7 +27,7 @@ class NumpyTests(SimpleTestCase):
Numpy's array-index syntax allows a template to access a certain
item of a subscriptable object.
"""
- output = render(
+ output = self.engine.render_to_string(
'numpy-array-index01',
{'var': numpy.array(["first item", "second item"])},
)
@@ -39,11 +38,11 @@ class NumpyTests(SimpleTestCase):
"""
Fail silently when the array index is out of range.
"""
- output = render(
+ output = self.engine.render_to_string(
'numpy-array-index02',
{'var': numpy.array(["first item", "second item"])},
)
- if settings.TEMPLATE_STRING_IF_INVALID:
+ if self.engine.string_if_invalid:
self.assertEqual(output, 'INVALID')
else:
self.assertEqual(output, '')