Skip to content

Commit eeddbb1

Browse files
committed
Update package documentation and PyPi overview
1 parent 92467da commit eeddbb1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

docs/features.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,26 @@ other headless browsers).
139139
assert res.code == 200
140140
141141
142+
``request_ctx`` - request context
143+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144+
145+
The request context which contains all request relevant information.
146+
147+
.. hint::
148+
149+
The request context has been pushed implicitly any time the ``app``
150+
fixture is applied and is kept around during test execution, so it's easy
151+
to introspect the data:
152+
153+
.. code:: python
154+
155+
from flask import request, url_for
156+
157+
def test_request_headers(client):
158+
res = client.get(url_for('ping'), headers=[('X-Something', '42')])
159+
assert request.headers['X-Something'] == '42'
160+
161+
142162
Content negotiation
143163
~~~~~~~~~~~~~~~~~~~
144164

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- ``config`` - you application config,
1818
- ``live_server`` - runs an application in the background (useful for tests
1919
with `Selenium <http://www.seleniumhq.org>`_ and other headless browsers),
20+
- ``request_ctx`` - the request context,
2021
- ``accept_json``, ``accept_jsonp``, ``accept_any`` - accept headers
2122
suitable to use as parameters in ``client``.
2223

0 commit comments

Comments
 (0)