Pylons / webtest

Wraps any WSGI application and makes it easy to send test requests to that application, without starting up an HTTP server.
https://docs.pylonsproject.org/projects/webtest/en/latest/
Other
336 stars 110 forks source link

Add default headers to TestApp #255

Closed quazgar closed 8 months ago

quazgar commented 1 year ago

Feature Request

It would be great if webtest.app.TestApp could have default headers set for all requests. Similar to the cookie jar.

Describe alternatives you've considered I am currently just adding headers for every request I make.

Additional context May also be useful for cases where headers are used for CSRF tokens or the like.

gawel commented 1 year ago

Try TestApp(extra_environ={HTTP_YOUR_HEADER="value"})