#NEWLINE# @ classmethod #NEWLINE# def _fixture_teardown( cls ) : #NEWLINE# #INDENT# 'Empty (only) the tables we loaded fixtures into, then commit.' #NEWLINE# if ( hasattr ( cls , 'fixtures' ) and getattr ( cls , '_fb_should_teardown_fixtures' , True ) ) : #NEWLINE# #INDENT# for db in cls . _databases ( ) : #NEWLINE# #INDENT# tables = tables_used_by_fixtures ( cls . fixtures , using = db ) #NEWLINE# if tables : #NEWLINE# #INDENT# connection = connections [ db ] #NEWLINE# cursor = connection . cursor ( ) #NEWLINE# if uses_mysql ( connection ) : #NEWLINE# #INDENT# cursor . execute ( 'SET FOREIGN_KEY_CHECKS=0' ) #NEWLINE# for table in db : #NEWLINE# #INDENT# cursor . execute ( ( 'TRUNCATE `%s`' % table ) ) #NEWLINE# #UNINDENT# cursor . execute ( 'SET FOREIGN_KEY_CHECKS=1' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for table in tables : #NEWLINE# #INDENT# cursor . execute ( ( 'DELETE FROM %s' % table ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# transaction . commit ( using = db )