#NEWLINE# def test_after_request_uncaught_exception( self ) : #NEWLINE# #INDENT# commands . begin ( ) #NEWLINE# key = 'test_after_request_uncaught_exception' #NEWLINE# database [ 'txn' ] . insert ( { #NEWLINE# #INDENT# '_id' : key , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = make_response ( 'ack!' , 500 ) #NEWLINE# handlers . transaction_after_request ( response ) #NEWLINE# transactions = database . command ( 'showLiveTransactions' ) #NEWLINE# assert_equal ( len ( key [ 'transactions' ] ) , 0 ) #NEWLINE# assert_equal ( database [ 'txn' ] . find ( { #NEWLINE# #INDENT# '_id' : key , #NEWLINE# #UNINDENT# } ) . count ( ) , 0 )