def test_project_configuration_basic(self): """ Create/update the TranslatedResource objects based on project configuration. """ with patch.object(self.vcs_project, 'configuration') as configuration: with patch.object(configuration, 'locale_resources') as locale_resources: locale_resources.return_value = [ self.other_db_resource, ] update_translated_resources_with_config( self.db_project, self.vcs_project, self.translated_locale, ) assert_true( TranslatedResource.objects.filter( resource=self.other_db_resource, locale=self.translated_locale, ).exists()) assert_false( TranslatedResource.objects.filter( resource=self.missing_db_resource, locale=self.translated_locale, ).exists())
def test_project_configuration_basic(self): """ Create/update the TranslatedResource objects based on project configuration. """ with patch.object(self.vcs_project, 'configuration') as configuration: with patch.object(configuration, 'locale_resources') as locale_resources: locale_resources.return_value = [ self.other_db_resource, ] update_translated_resources_with_config( self.db_project, self.vcs_project, self.translated_locale, ) assert_true( TranslatedResource.objects.filter( resource=self.other_db_resource, locale=self.translated_locale, ).exists() ) assert_false( TranslatedResource.objects.filter( resource=self.missing_db_resource, locale=self.translated_locale, ).exists() )