Fixed #18356 -- Gave the test client signals.template_rendered call a unique dispatch_uid

This prevents the test client context from being lost when the client
is used in a nested fashion.
This commit is contained in:
Bojan Mihelac 2013-02-04 16:50:15 +01:00 committed by Tim Graham
parent 453915bb12
commit 0cac4fbf69
5 changed files with 25 additions and 3 deletions

View file

@ -925,6 +925,14 @@ class ContextTests(TestCase):
finally:
django.template.context._standard_context_processors = None
def test_nested_requests(self):
"""
response.context is not lost when view call another view.
"""
response = self.client.get("/test_client_regress/nested_view/")
self.assertEqual(response.context.__class__, Context)
self.assertEqual(response.context['nested'], 'yes')
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class SessionTests(TestCase):