#NEWLINE# def test_no_new_translations( self ) : #NEWLINE# #INDENT# "\n        Don't change any resource if there aren't any new translations.\n        " #NEWLINE# TranslationFactory . create ( locale = self . translated_locale , entity = self . main_db_entity , approved = True , date = aware_datetime ( 2015 , 1 , 1 ) ) #NEWLINE# with patch . object ( mock_has_changed . main_db_entity , 'has_changed' , return_value = False ) as mock_has_changed : #NEWLINE# #INDENT# resource_file = MagicMock ( ) #NEWLINE# self . changeset . update_vcs_entity ( self . translated_locale , self . main_db_entity , MagicMock ( ) ) #NEWLINE# self . changeset . vcs_project . resources = { #NEWLINE# #INDENT# self . main_db_entity . resource . path : resource_file , #NEWLINE# #UNINDENT# } #NEWLINE# self . changeset . execute_update_vcs ( ) #NEWLINE# assert mock_has_changed . called #NEWLINE# assert ( not resource_file . save . called )