#NEWLINE# def test_it_should_raise_exception_and_stop_process_when_a_migration_file_is_not_present_and_force_files_is_set_and_is_down( self ) : #NEWLINE# #INDENT# self . initial_config . update ( { #NEWLINE# #INDENT# 'schema_version' : None , #NEWLINE# 'label_version' : None , #NEWLINE# 'database_migrations_dir' : [ 'migrations' , '.' ] , #NEWLINE# 'force_use_files_on_down' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# config = Config ( self . initial_config ) #NEWLINE# all_schema_migrations = [ Migration ( file_name = '20090214115200_02_test_migration.migration' , version = '20090214115200' , sql_up = 'sql up 02' , sql_down = 'sql down 02' , id = 2 ) , Migration ( file_name = '20090214115301_03_test_migration.migration' , version = '20090214115301' , sql_up = 'sql up 03.1' , sql_down = 'sql down 03.1' , id = 3 ) , Migration ( file_name = '20090214115300_04_test_migration.migration' , version = '20090214115400' , sql_up = 'sql up 04' , sql_down = 'sql down 04' , id = 4 ) ] #NEWLINE# main = Main ( sgdb = Mock ( ** { #NEWLINE# #INDENT# 'get_all_schema_migrations.return_value' : config , #NEWLINE# 'get_all_schema_versions.return_value' : [ '20090214115200' , '20090214115301' , '20090214115400' ] , #NEWLINE# 'get_version_id_from_version_number.side_effect' : get_version_id_from_version_number_side_effect , #NEWLINE# #UNINDENT# } ) , config = config ) #NEWLINE# self . assertRaisesWithMessage ( Exception , 'impossible to migrate down: one of the versions was not found (20090214115301)' , main . _get_migration_files_to_be_executed , '20090214115400' , '20090214115200' , False )