diff options
| author | Gael Pasgrimaud <gael@gawel.org> | 2014-04-16 20:32:11 +0200 |
|---|---|---|
| committer | Gael Pasgrimaud <gael@gawel.org> | 2014-04-16 20:34:04 +0200 |
| commit | b31cdebb5655b6e2fe0620d807c2d85f5b0f6c18 (patch) | |
| tree | e84f68d9c8caaeb9db3f374b30bf49fc5c190480 /docs | |
| parent | bc5b86cc8c2feef77cd852efe65527148b241a14 (diff) | |
| download | webtest-b31cdebb5655b6e2fe0620d807c2d85f5b0f6c18.tar.gz | |
add authorization property
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/testapp.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/testapp.rst b/docs/testapp.rst index 06bba54..fb7066e 100644 --- a/docs/testapp.rst +++ b/docs/testapp.rst @@ -96,6 +96,17 @@ If you want *all* your requests to have this key, do: app = TestApp(my_app, extra_environ=dict(REMOTE_USER='bob')) +If you have to use HTTP authorization you can use the ``.authorization`` +property to set the ``HTTP_AUTHORIZATION`` key of the extra_environ +dictionnary: + +.. code-block:: python + + app = TestApp(my_app) + app.authorization = ('Basic', ('user', 'password')) + +Only Basic auth is supported for now. + Testing a non wsgi application ------------------------------ |
