#NEWLINE# def test_db_sync_upgrade( self ) : #NEWLINE# #INDENT# init_ver = 55 #NEWLINE# with test_utils . nested ( mock . patch . object ( migration , '_find_migrate_repo' ) , mock . patch . object ( versioning_api , 'upgrade' ) ) as ( mock_find_repo , mock_upgrade ) : #NEWLINE# #INDENT# mock_find_repo . return_value = self . return_value #NEWLINE# self . mock_api_db_version . return_value = ( self . test_version - 1 ) #NEWLINE# migration . db_sync ( self . engine , self . path , init_ver . test_version , init_ver ) #NEWLINE# mock_upgrade . assert_called_once_with ( self . engine , self . return_value , self . test_version )