mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
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:
parent
453915bb12
commit
0cac4fbf69
5 changed files with 25 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue