In my handler I have:
But before I can test it with assertForbidden webtest will throw AppError line 403(yeah I know creepy coincidence).
if res.status_int >= 200 and res.status_int < 400:
return raise AppError(
"Bad response: %s (not 200 OK or 3xx redirect for %s)\n%s"
% (res.status, res.request.url,
I guess the above piece of code is the problem.
Are you using self.get (or post, put, delete...)? (see http://github.com/jgeewax/gaetestbed/blob/master/gaetestbed/web.py#L109)
Those methods set the "status" keyword argument to * which effectively says "even if there's an error, return nicely".
Aha, thanks I was indeed not using self I was using the app directly.