#NEWLINE# @ patch ( 'simple_db_migrate.main.Main._get_migration_files_to_be_executed' , return_value = [ ] ) #NEWLINE# def test_it_should_do_migration_down_if_a_label_was_specified_and_a_version_was_not_specified_and_label_is_present_at_database_and_force_execute_old_migrations_versions_is_set( self , files_to_be_executed_mock ) : #NEWLINE# #INDENT# self . initial_config . update ( { #NEWLINE# #INDENT# 'schema_version' : None , #NEWLINE# 'label_version' : 'test_label' , #NEWLINE# 'database_migrations_dir' : [ 'migrations' , '.' ] , #NEWLINE# 'force_execute_old_migrations_versions' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# config = Config ( files_to_be_executed_mock . initial_config ) #NEWLINE# main = Main ( sgdb = Mock ( ** { #NEWLINE# #INDENT# 'get_current_schema_version.return_value' : '20090214115600' , #NEWLINE# 'get_version_number_from_label.return_value' : '20090214115300' , #NEWLINE# 'get_version_id_from_version_number.side_effect' : get_version_id_from_version_number_side_effect , #NEWLINE# #UNINDENT# } ) , config = config ) #NEWLINE# main . execute ( ) #NEWLINE# files_to_be_executed_mock . assert_called_with ( '20090214115600' , '20090214115300' , False )