mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #12571 -- Attached originating WSGIRequest to test client responses.
Originating WSGIRequests are now attached to the ``wsgi_request`` attribute of the ``HttpResponse`` returned by the testing client. Thanks rvdrijst for the suggestion.
This commit is contained in:
committed by
Tim Graham
parent
9ae17d994b
commit
9eb16031ca
@@ -579,6 +579,9 @@ Tests
|
||||
* :meth:`~django.test.TransactionTestCase.assertNumQueries` now prints
|
||||
out the list of executed queries if the assertion fails.
|
||||
|
||||
* The ``WSGIRequest`` instance generated by the test handler is now attached to
|
||||
the :attr:`django.test.Response.wsgi_request` attribute.
|
||||
|
||||
Validators
|
||||
^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -427,6 +427,13 @@ Specifically, a ``Response`` object has the following attributes:
|
||||
|
||||
The request data that stimulated the response.
|
||||
|
||||
.. attribute:: wsgi_request
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The ``WSGIRequest`` instance generated by the test handler that
|
||||
generated the response.
|
||||
|
||||
.. attribute:: status_code
|
||||
|
||||
The HTTP status of the response, as an integer. See
|
||||
|
||||
Reference in New Issue
Block a user