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

@ -8,9 +8,8 @@ server = {
app = {
'root' : 'test.controllers.root.RootController',
'modules' : ['test'],
'static_root' : '%(confdir)s/../../public',
'static_root' : '%(confdir)s/../../public',
'template_path' : '%(confdir)s/../templates',
'debug' : True,
'errors' : {
'404' : '/error/404',
'__force_dict__' : True
@ -20,6 +19,6 @@ app = {
# Custom Configurations must be in Python dictionary format::
#
# foo = {'bar':'baz'}
#
#
# All configurations are accessible at::
# pecan.conf

View File

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