diff --git a/compressor/offline/django.py b/compressor/offline/django.py index 107c6e4..2b229fa 100644 --- a/compressor/offline/django.py +++ b/compressor/offline/django.py @@ -26,7 +26,7 @@ def handle_extendsnode(extendsnode, block_context=None, original=None): extendsnode.nodelist.get_nodes_by_type(BlockNode)) block_context.add_blocks(blocks) - context = Context(settings.COMPRESS_OFFLINE_CONTEXT) + context = Context(dict(settings.COMPRESS_OFFLINE_CONTEXT)) if original is not None: context.template = original diff --git a/compressor/test_settings.py b/compressor/test_settings.py index d10e02d..abda256 100644 --- a/compressor/test_settings.py +++ b/compressor/test_settings.py @@ -23,6 +23,7 @@ INSTALLED_APPS = [ 'compressor', 'coffin', 'sekizai', + 'overextends', ] if django.VERSION < (1, 8): INSTALLED_APPS.append('jingo') diff --git a/compressor/tests/test_offline.py b/compressor/tests/test_offline.py index 5efe802..aa10cf0 100644 --- a/compressor/tests/test_offline.py +++ b/compressor/tests/test_offline.py @@ -644,3 +644,10 @@ class OfflineCompressJingoTestCase(OfflineTestCaseMixin, TestCase): env.globals['url_for'] = url_for return env + + +class OfflineGenerationOverextendsTestCase(OfflineTestCaseMixin, TestCase): + templates_dir = "test_overextends" + expected_hash = "e993b2a53994" + # overextends not supported for Jinja2 yet. + engines = ("django",) diff --git a/compressor/tests/test_templates/test_overextends/base.html b/compressor/tests/test_templates/test_overextends/base.html new file mode 100644 index 0000000..1406ac4 --- /dev/null +++ b/compressor/tests/test_templates/test_overextends/base.html @@ -0,0 +1,7 @@ +{% load compress %}{% spaceless %} +{% compress js %} + +{% endcompress %} +{% endspaceless %} diff --git a/compressor/tests/test_templates/test_overextends/test_compressor_offline.html b/compressor/tests/test_templates/test_overextends/test_compressor_offline.html new file mode 100644 index 0000000..c731be0 --- /dev/null +++ b/compressor/tests/test_templates/test_overextends/test_compressor_offline.html @@ -0,0 +1 @@ +{% overextends "base.html" %} diff --git a/requirements/tests.txt b/requirements/tests.txt index 9b1a5e4..4c5e008 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -9,3 +9,4 @@ unittest2==1.0.0 coffin==0.4.0 jingo==0.7 django-sekizai==0.8.2 +django-overextends==0.4.0 diff --git a/tox.ini b/tox.ini index ae8ca0a..c25e80f 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,7 @@ two = jingo==0.7 coffin==0.4.0 django-sekizai==0.8.2 + django-overextends==0.4.0 two_six = flake8==2.4.0 coverage==3.7.1 @@ -23,6 +24,7 @@ two_six = jingo==0.7 coffin==0.4.0 django-sekizai==0.8.2 + django-overextends==0.4.0 three = flake8==2.4.0 coverage==3.7.1 @@ -34,6 +36,7 @@ three = jingo==0.7 coffin==0.4.0 django-sekizai==0.8.2 + django-overextends==0.4.0 three_two = flake8==2.4.0 coverage==3.7.1 @@ -45,6 +48,7 @@ three_two = jingo==0.7 coffin==0.4.0 django-sekizai==0.8.2 + django-overextends==0.4.0 [tox] envlist = {py26,py27}-1.4.X,