#NEWLINE# def __call__( self , test_func ) : #NEWLINE# #INDENT# from django.test import TransactionTestCase #NEWLINE# if ( isinstance ( test_func , type ) and issubclass ( test_func , TransactionTestCase ) ) : #NEWLINE# #INDENT# original_pre_setup = test_func . _pre_setup #NEWLINE# original_post_teardown = test_func . _post_teardown #NEWLINE# def _pre_setup( innerself ) : #NEWLINE# #INDENT# self . enable ( ) #NEWLINE# original_pre_setup ( innerself ) #NEWLINE# #UNINDENT# def _post_teardown( innerself ) : #NEWLINE# #INDENT# original_post_teardown ( innerself ) #NEWLINE# self . disable ( ) #NEWLINE# #UNINDENT# test_func . _pre_setup = _pre_setup #NEWLINE# test_func . _post_teardown = _post_teardown #NEWLINE# return test_func #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# @ wraps ( test_func ) #NEWLINE# def inner( * args , **kwargs ) : #NEWLINE# #INDENT# with self : #NEWLINE# #INDENT# return test_func ( * args , ** kwargs ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return inner