drop support for Jinja2 for Python 3.2
This commit is contained in:
@@ -25,6 +25,8 @@ else:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
|
|
||||||
|
_TEST_JINJA2 = not(sys.version_info.major == 3 and sys.version_info.minor == 2)
|
||||||
|
|
||||||
|
|
||||||
class OfflineTestCaseMixin(object):
|
class OfflineTestCaseMixin(object):
|
||||||
template_name = "test_compressor_offline.html"
|
template_name = "test_compressor_offline.html"
|
||||||
@@ -33,10 +35,10 @@ class OfflineTestCaseMixin(object):
|
|||||||
templates_dir = ""
|
templates_dir = ""
|
||||||
expected_hash = ""
|
expected_hash = ""
|
||||||
# Engines to test
|
# Engines to test
|
||||||
if sys.version_info.major == 3 and sys.version_info.minor == 2:
|
if _TEST_JINJA2:
|
||||||
engines = ("django",)
|
|
||||||
else:
|
|
||||||
engines = ("django", "jinja2")
|
engines = ("django", "jinja2")
|
||||||
|
else:
|
||||||
|
engines = ("django",)
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self._old_compress = settings.COMPRESS_ENABLED
|
self._old_compress = settings.COMPRESS_ENABLED
|
||||||
@@ -288,6 +290,7 @@ class OfflineGenerationTestCase(OfflineTestCaseMixin, TestCase):
|
|||||||
self.assertRaises(OfflineGenerationError,
|
self.assertRaises(OfflineGenerationError,
|
||||||
self.template.render, Context({}))
|
self.template.render, Context({}))
|
||||||
|
|
||||||
|
@unittest.skipUnless(_TEST_JINJA2, "No Jinja2 testing")
|
||||||
def test_rendering_without_manifest_raises_exception_jinja2(self):
|
def test_rendering_without_manifest_raises_exception_jinja2(self):
|
||||||
# flush cached manifest
|
# flush cached manifest
|
||||||
flush_offline_manifest()
|
flush_offline_manifest()
|
||||||
|
|||||||
14
tox.ini
14
tox.ini
@@ -20,16 +20,6 @@ three =
|
|||||||
BeautifulSoup4
|
BeautifulSoup4
|
||||||
jingo
|
jingo
|
||||||
coffin
|
coffin
|
||||||
three_two =
|
|
||||||
flake8
|
|
||||||
coverage
|
|
||||||
html5lib
|
|
||||||
mock
|
|
||||||
jinja2==2.6
|
|
||||||
lxml
|
|
||||||
BeautifulSoup4
|
|
||||||
jingo
|
|
||||||
coffin
|
|
||||||
|
|
||||||
[tox]
|
[tox]
|
||||||
envlist =
|
envlist =
|
||||||
@@ -64,7 +54,7 @@ deps =
|
|||||||
basepython = python3.2
|
basepython = python3.2
|
||||||
deps =
|
deps =
|
||||||
Django>=1.6,<1.7
|
Django>=1.6,<1.7
|
||||||
{[deps]three_two}
|
{[deps]three}
|
||||||
|
|
||||||
[testenv:py27-1.6.X]
|
[testenv:py27-1.6.X]
|
||||||
basepython = python2.7
|
basepython = python2.7
|
||||||
@@ -90,7 +80,7 @@ basepython = python3.2
|
|||||||
deps =
|
deps =
|
||||||
Django>=1.5,<1.6
|
Django>=1.5,<1.6
|
||||||
django-discover-runner
|
django-discover-runner
|
||||||
{[deps]three_two}
|
{[deps]three}
|
||||||
|
|
||||||
[testenv:py27-1.5.X]
|
[testenv:py27-1.5.X]
|
||||||
basepython = python2.7
|
basepython = python2.7
|
||||||
|
|||||||
Reference in New Issue
Block a user