diff options
author | Alberto Galera <galerajimenez@gmail.com> | 2017-01-05 13:27:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-05 13:27:16 +0100 |
commit | 1c412f889c0fcc087b726069ff91f69ecfae8e88 (patch) | |
tree | d27d1c123120680f73797e9aca3103eda41dbe72 | |
parent | 5fcbaca48241b331fbf403c98d2a9403ca1ae0cc (diff) | |
download | bottle-1c412f889c0fcc087b726069ff91f69ecfae8e88.tar.gz |
Receiving a code other than 2xx generate exception
expect_errors=True not generate exception for "bad requests" ( status != 200)
I have checked /logout only with number
-rwxr-xr-x | docs/recipes.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/recipes.rst b/docs/recipes.rst index 168e26d..757a61d 100755 --- a/docs/recipes.rst +++ b/docs/recipes.rst @@ -101,11 +101,11 @@ Example using `WebTest <http://webtest.pythonpaste.org/>`_ and `Nose <http://rea assert app.get('/admin').status == '200 OK' # fetch a page successfully - app.get('/logout') # log out + assert app.get('/logout').status_code = 200 # log out app.reset() # drop the cookie # fetch the same page, unsuccessfully - assert app.get('/admin').status == '401 Unauthorized' + assert app.get('/admin', expect_errors=True).status == '401 Unauthorized' Embedding other WSGI Apps |