diff options
author | Tim Graham <timograham@gmail.com> | 2015-09-03 15:52:04 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-09-23 19:31:10 -0400 |
commit | 5e450c52aafb62b9d83c8ac08892e0b92cbec4aa (patch) | |
tree | dbc6b0360aba68d492dc0925d527c9c0f237f401 /tests/shortcuts | |
parent | 75374d3797c2cd2423982a870bb0bc74821e951f (diff) | |
download | django-5e450c52aafb62b9d83c8ac08892e0b92cbec4aa.tar.gz |
Removed current_app argument to render() and TemplateResponse().
Per deprecation timeline.
Diffstat (limited to 'tests/shortcuts')
-rw-r--r-- | tests/shortcuts/tests.py | 10 | ||||
-rw-r--r-- | tests/shortcuts/urls.py | 2 | ||||
-rw-r--r-- | tests/shortcuts/views.py | 16 |
3 files changed, 0 insertions, 28 deletions
diff --git a/tests/shortcuts/tests.py b/tests/shortcuts/tests.py index ef7a0edc7a..5c44ab20f5 100644 --- a/tests/shortcuts/tests.py +++ b/tests/shortcuts/tests.py @@ -103,18 +103,8 @@ class ShortcutTests(SimpleTestCase): self.assertEqual(response.content, b'Jinja2\n') @ignore_warnings(category=RemovedInDjango110Warning) - def test_render_with_current_app(self): - response = self.client.get('/render/current_app/') - self.assertEqual(response.context.request.current_app, "foobar_app") - - @ignore_warnings(category=RemovedInDjango110Warning) def test_render_with_dirs(self): response = self.client.get('/render/dirs/') self.assertEqual(response.status_code, 200) self.assertEqual(response.content, b'spam eggs\n') self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8') - - @ignore_warnings(category=RemovedInDjango110Warning) - def test_render_with_current_app_conflict(self): - with self.assertRaises(ValueError): - self.client.get('/render/current_app_conflict/') diff --git a/tests/shortcuts/urls.py b/tests/shortcuts/urls.py index 449a840f73..e125709296 100644 --- a/tests/shortcuts/urls.py +++ b/tests/shortcuts/urls.py @@ -18,6 +18,4 @@ urlpatterns = [ url(r'^render/dirs/$', views.render_with_dirs), url(r'^render/status/$', views.render_view_with_status), url(r'^render/using/$', views.render_view_with_using), - url(r'^render/current_app/$', views.render_view_with_current_app), - url(r'^render/current_app_conflict/$', views.render_view_with_current_app_conflict), ] diff --git a/tests/shortcuts/views.py b/tests/shortcuts/views.py index f988edf8d9..e4638106ac 100644 --- a/tests/shortcuts/views.py +++ b/tests/shortcuts/views.py @@ -109,19 +109,3 @@ def render_view_with_status(request): def render_view_with_using(request): using = request.GET.get('using') return render(request, 'shortcuts/using.html', using=using) - - -def render_view_with_current_app(request): - return render(request, 'shortcuts/render_test.html', { - 'foo': 'FOO', - 'bar': 'BAR', - }, current_app="foobar_app") - - -def render_view_with_current_app_conflict(request): - # This should fail because we don't passing both a current_app and - # context_instance: - return render(request, 'shortcuts/render_test.html', { - 'foo': 'FOO', - 'bar': 'BAR', - }, current_app="foobar_app", context_instance=RequestContext(request)) |