niwinz / django-jinja

Simple and nonobstructive jinja2 integration with Django.
http://niwinz.github.io/django-jinja/latest/
BSD 3-Clause "New" or "Revised" License
363 stars 102 forks source link

Patch setup_test_environment to manipulate response.context. #129

Closed glogiotatidis closed 9 years ago

glogiotatidis commented 9 years ago

This will allow the use of response.context in tests as well as self.assertTemplateUsed.

glogiotatidis commented 9 years ago

Original idea from http://stackoverflow.com/a/3827015

glogiotatidis commented 9 years ago

This test fails https://github.com/niwinz/django-jinja/blob/master/testing/testapp/tests.py#L347 which brings up the question: Since in 1.8 TEMPLATE_DEBUG is moved to TEMPLATE.OPTIONS.debug should we implement this? Does django-jinja default to the value of DEBUG in django 1.8?

niwinz commented 9 years ago

Thanks! It's depends, in django 1.8, TEMPLATE_DEBUG is deprecated and django-jina starts using DEBUG directly in some cases (in really the use of debug is copied from django 1.8 jinja engine).

In any case I should review it in deph for the next release for make the usage of debug in more consistent way.

coagulant commented 9 years ago

Actually this fixes #125 Just posting in case someone is using PyPI version 1.4.1 and not latest master :+1:

glogiotatidis commented 9 years ago

\ο/