summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/testapp.rst9
-rw-r--r--webtest/app.py8
2 files changed, 14 insertions, 3 deletions
diff --git a/docs/testapp.rst b/docs/testapp.rst
index 430d0a9..911daca 100644
--- a/docs/testapp.rst
+++ b/docs/testapp.rst
@@ -105,7 +105,14 @@ dictionary:
app = TestApp(my_app)
app.authorization = ('Basic', ('user', 'password'))
-Only Basic auth is supported for now.
+You can also use bearer token or JWT authorization types:
+
+.. code-block:: python
+
+ app = TestApp(my_app)
+ app.authorization = ('Bearer', 'mytoken')
+ # or
+ app.authorization = ('JWT', 'myjwt')
Testing a non wsgi application
------------------------------
diff --git a/webtest/app.py b/webtest/app.py
index 1c19e94..5b7a3e5 100644
--- a/webtest/app.py
+++ b/webtest/app.py
@@ -184,8 +184,12 @@ class TestApp(object):
self.JSONEncoder = json_encoder
def get_authorization(self):
- """Allow to set the HTTP_AUTHORIZATION environ key. Value should looks
- like ``('Basic', ('user', 'password'))``
+ """Allow to set the HTTP_AUTHORIZATION environ key. Value should look
+ like one of the following:
+
+ * ``('Basic', ('user', 'password'))``
+ * ``('Bearer', 'mytoken')``
+ * ``('JWT', 'myjwt')``
If value is None the the HTTP_AUTHORIZATION is removed
"""