Fix error handling tests for pecan

The debug middleware always returns a 200 status, so
disable it.

The actual response status is the full string, not just
the number, so look for that.
This commit is contained in:
Doug Hellmann 2012-12-07 12:01:20 -05:00
parent 38f5dd2bfd
commit 2277370fca
2 changed files with 3 additions and 4 deletions

View File

@ -10,7 +10,6 @@ app = {
'modules' : ['test'], 'modules' : ['test'],
'static_root' : '%(confdir)s/../../public', 'static_root' : '%(confdir)s/../../public',
'template_path' : '%(confdir)s/../templates', 'template_path' : '%(confdir)s/../templates',
'debug' : True,
'errors' : { 'errors' : {
'404' : '/error/404', '404' : '/error/404',
'__force_dict__' : True '__force_dict__' : True

View File

@ -31,7 +31,7 @@ class TestWS(FunctionalTest):
expect_errors=True expect_errors=True
) )
print res print res
assert res.status == 400 self.assertEqual(res.status, '400 Bad Request')
a = json.loads(res.body) a = json.loads(res.body)
print a print a
assert a['faultcode'] == 'Client' assert a['faultcode'] == 'Client'