def test_unicode():
 tstr = u'\x00xCAFE'
 def badapp(environ, start_response):
  start_response('200 OK', [])
  raise HTTPBadRequest(tstr)
 newapp = HTTPExceptionHandler(badapp)
 assert (tstr.encode('utf-8') in ''.join(newapp({'HTTP_ACCEPT': 'text/html'}, (lambda a, b, c=None: None))))
 assert (tstr.encode('utf-8') in ''.join(newapp({'HTTP_ACCEPT': 'text/plain'}, (lambda a, b, c=None: None))))

def test_unicode ( ) : tstr = u'\x00xCAFE' def badapp ( environ , start_response ) : start_response ( '200 OK' , [ ] ) raise HTTPBadRequest ( tstr ) newapp = HTTPExceptionHandler ( badapp ) assert ( tstr . encode ( 'utf-8' ) in '' . join ( newapp ( { 'HTTP_ACCEPT' : 'text/html' } , ( lambda a , b , c = None : None ) ) ) ) assert ( tstr . encode ( 'utf-8' ) in '' . join ( newapp ( { 'HTTP_ACCEPT' : 'text/plain' } , ( lambda a , b , c = None : None ) ) ) )
verify unicode output .