tests: make test_finish_failed_request work standalone (#36515)
This commit is contained in:
parent
57f96ee3b4
commit
f1b90ce1e2
|
@ -62,10 +62,16 @@ def test_plaintext_error():
|
|||
assert not re.findall('^>.*\d+.*s = pub._generate_plaintext_error', s, re.MULTILINE)
|
||||
|
||||
def test_finish_failed_request():
|
||||
pub.USE_LONG_TRACES = False
|
||||
try:
|
||||
raise Exception('foo')
|
||||
except:
|
||||
exc_type, exc_value, tb = sys.exc_info()
|
||||
|
||||
req = get_request()
|
||||
pub._set_request(req)
|
||||
body = pub.finish_failed_request()
|
||||
assert '<h1>Internal Server Error</h1>' in body
|
||||
assert '<h1>Internal Server Error</h1>' in str(body)
|
||||
|
||||
req = get_request()
|
||||
pub._set_request(req)
|
||||
|
|
Loading…
Reference in New Issue