#NEWLINE# def test_it_should_get_all_schema_migrations_to_check_wich_one_has_to_be_removed_if_current_and_destiny_version_are_different_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# #UNINDENT# } ) #NEWLINE# config = Config ( all_schema_migrations . 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 = '20090214115300_03_test_migration.migration' , version = '20090214115300' , sql_up = 'sql up 03' , sql_down = 'sql down 03' , 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' : all_schema_migrations , #NEWLINE# 'get_all_schema_versions.return_value' : [ '20090214115200' , '20090214115300' , '20090214115400' ] , #NEWLINE# 'get_version_id_from_version_number.side_effect' : get_version_id_from_version_number_side_effect , #NEWLINE# #UNINDENT# } ) , config = config ) #NEWLINE# self . assertEqual ( [ all_schema_migrations [ ( - 1 ) ] , all_schema_migrations [ ( - 2 ) ] ] , main . _get_migration_files_to_be_executed ( '20090214115400' , '20090214115200' , False ) )