Permalink
Browse files

Remove deprecated jingo.render().

  • Loading branch information...
1 parent 19f0533 commit c5a95c1cbf66ab8b8452afe0ad434fccd5f04298 James Socol committed Nov 13, 2012
Showing with 3 additions and 20 deletions.
  1. +0 −11 jingo/__init__.py
  2. +2 −7 jingo/tests/test_basics.py
  3. +1 −2 jingo/tests/test_views.py
View
@@ -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.
@@ -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')
@@ -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})

0 comments on commit c5a95c1

Please sign in to comment.