Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove deprecated jingo.render().

  • Loading branch information...
commit c5a95c1cbf66ab8b8452afe0ad434fccd5f04298 1 parent 19f0533
James Socol authored
View
11 jingo/__init__.py
@@ -71,17 +71,6 @@ def get_env():
return e
-def render(request, template, context=None, **kwargs):
- """
- .. deprecated:: 0.4
- use ``django.shortcuts.render()``
- """
- warnings.warn('jingo.render() has been deprecated. Use '
- 'django.shortcuts.render().', DeprecationWarning)
- rendered = render_to_string(request, template, context)
- return http.HttpResponse(rendered, **kwargs)
-
-
def render_to_string(request, template, context=None):
"""
Render a template into a string.
View
9 jingo/tests/test_basics.py
@@ -1,3 +1,4 @@
+from django.shortcuts import render
import jinja2
from nose.tools import eq_
@@ -11,7 +12,7 @@ def test_render(mock_env):
mock_template = Mock()
mock_env.get_template.return_value = mock_template
- response = jingo.render(Mock(), sentinel.template, status=32)
+ response = render(Mock(), sentinel.template, status=32)
mock_env.get_template.assert_called_with(sentinel.template)
assert mock_template.render.called
@@ -26,12 +27,6 @@ def test_render_to_string(mock_env):
eq_(rendered, 'The answer is 42')
-def test_render_with_Template():
- template = jinja2.Environment().from_string('xxx')
- response = jingo.render(Mock(), template)
- eq_(response.content, 'xxx')
-
-
@patch('jingo.env.get_template')
def test_inclusion_tag(get_template):
@jingo.register.inclusion_tag('xx.html')
View
3  jingo/tests/test_views.py
@@ -7,8 +7,7 @@
from jingo import get_env, render_to_string
-@patch('jingo.render')
-def test_direct_to_template(mock_render):
+def test_direct_to_template():
response = direct_to_template(sentinel.request,
'jinja_app/test_nonoverride.html',
{'x': 1})
Please sign in to comment.
Something went wrong with that request. Please try again.