<s> import copy <EOL> from django . core import management <EOL> from django . conf import settings <EOL> import django . template . loaders . app_directories <EOL> from south . hacks import hacks <EOL> from south . management . commands . syncdb import Command as SyncCommand <EOL> class MigrateAndSyncCommand ( SyncCommand ) : <EOL> """<STR_LIT>""" <EOL> option_list = copy . deepcopy ( SyncCommand . option_list ) <EOL> for opt in option_list : <EOL> if "<STR_LIT>" == opt . get_opt_string ( ) : <EOL> opt . default = True <EOL> break <EOL> def patch_for_test_db_setup ( ) : <EOL> management . get_commands ( ) <EOL> if hasattr ( settings , "<STR_LIT>" ) and not settings . SOUTH_TESTS_MIGRATE : <EOL> management . _commands [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> else : <EOL> management . _commands [ '<STR_LIT>' ] = MigrateAndSyncCommand ( ) <EOL> hacks . patch_flush_during_test_db_creation ( ) </s>
