'If the return value of the decorated function cannot be I{JSON} encoded
then the response generated has the I{INTERNAL SERVER ERROR} code.'

@validateLogging(_assertTracebackLogged(TypeError))
def test_illegalResult(self, logger):

    objects = {'foo': object()}
    request = dummyRequest('GET', '/foo/bar', Headers(), '')
    self.render(self.application(logger, objects).app.resource(), request)
    self.assertEqual(INTERNAL_SERVER_ERROR, request._code)
