summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Galera <galerajimenez@gmail.com>2017-01-05 13:27:16 +0100
committerGitHub <noreply@github.com>2017-01-05 13:27:16 +0100
commit1c412f889c0fcc087b726069ff91f69ecfae8e88 (patch)
treed27d1c123120680f73797e9aca3103eda41dbe72
parent5fcbaca48241b331fbf403c98d2a9403ca1ae0cc (diff)
downloadbottle-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-xdocs/recipes.rst4
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