On Sunday, December 14, 2014 12:27:23 AM UTC+1, Tres Seaver wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12/12/2014 08:15 PM, Kevin Engle wrote:
>
> > Is there a better way to ensure my application is throwing an
> > HTTPBadRequest?
>
> Pass 'expect_errors' to the app method in question, and then test the
> status code of the response.
>
>
You can also specify a status:
resp = app.get('/', status=400)
or
resp = app.get('/', status='*')
then check the status
assert resp.status_int == 400
>
> Tres.
> - --
> ===================================================================
> Tres Seaver +1 540-429-0999 [email protected]
> <javascript:>
> Palladion Software "Excellence by Design" http://palladion.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iEYEARECAAYFAlSMy0gACgkQ+gerLs4ltQ68PwCeLMQk/KN971N8zhIvyldGNpv3
> 4QAAn0I2DNktilqUEaPc78DWc2OFInhS
> =9+WB
> -----END PGP SIGNATURE-----
>
>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.