diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountingTransactionCount.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountingTransactionCount.xml index b398f5dca1574dc81e481e64fe9cdac9105724b4..4414ef5c0403c87efd64ca96ca7be2481d908603 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountingTransactionCount.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountingTransactionCount.xml @@ -55,6 +55,8 @@ if kw.get(\'stat\'):\n selection_params = context.portal_selections.getSelectionParamsFor(selection_name)\n selection_domain = context.portal_selections.getSelectionDomainDictFor(selection_name)\n + if callable(selection_domain):\n + selection_domain = selection_domain()\n selection_report = context.portal_selections.getSelectionReportDictFor(selection_name)\n if selection_domain:\n kwd[\'selection_domain\'] = selection_domain\n diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_statBalance.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_statBalance.xml index f39098999ac5b6dcb125ed46180cfc18458e0a02..40454c2becb8e4c48d4436406d42b31fbf295d88 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_statBalance.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_statBalance.xml @@ -60,6 +60,8 @@ params[\'omit_asset_decrease\'] = omit_asset_decrease\n params[\'omit_simulation\'] = True\n \n selection_domain = context.portal_selections.getSelectionDomainDictFor(selection_name)\n +if callable(selection_domain):\n + selection_domain = selection_domain()\n selection_report = context.portal_selections.getSelectionReportDictFor(selection_name)\n if selection_domain:\n params[\'selection_domain\'] = selection_domain\n diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index 0e8ebf59f2689cb1501556ab09d4aee23414f450..3559f242bc484e138a47eb958f1b33ee885e3d0c 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -1476 \ No newline at end of file +1477 \ No newline at end of file diff --git a/bt5/erp5_configurator_run_my_doc/PathTemplateItem/workflow_module/run_my_doc_configuration_workflow/8.xml b/bt5/erp5_configurator_run_my_doc/PathTemplateItem/workflow_module/run_my_doc_configuration_workflow/8.xml index 9e22b661d0df472ecfe04cbca926b1577fcecf16..4943d89319d47e1efa3431e706050d32298d11bb 100644 --- a/bt5/erp5_configurator_run_my_doc/PathTemplateItem/workflow_module/run_my_doc_configuration_workflow/8.xml +++ b/bt5/erp5_configurator_run_my_doc/PathTemplateItem/workflow_module/run_my_doc_configuration_workflow/8.xml @@ -68,7 +68,7 @@ BEFORE for possible transitions was: Enter Number of User</string> </value> </item> <item> <key> <string>title</string> </key> - <value> <string>Your Organisation</string> </value> + <value> <string>Your organisation</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_configurator_run_my_doc/PathTemplateItem/workflow_module/run_my_doc_configuration_workflow/9.xml b/bt5/erp5_configurator_run_my_doc/PathTemplateItem/workflow_module/run_my_doc_configuration_workflow/9.xml index d21280db3150606e838bddc5a588011397d0825e..4b896921f777e777a96a46e5770e6ae4de48deaa 100644 --- a/bt5/erp5_configurator_run_my_doc/PathTemplateItem/workflow_module/run_my_doc_configuration_workflow/9.xml +++ b/bt5/erp5_configurator_run_my_doc/PathTemplateItem/workflow_module/run_my_doc_configuration_workflow/9.xml @@ -69,7 +69,7 @@ </item> <item> <key> <string>title</string> </key> - <value> <string>Configuration of users</string> </value> + <value> <string>User accounts configuration</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_configurator_run_my_doc/SkinTemplateItem/portal_skins/erp5_configurator_run_my_doc/BusinessConfiguration_reindexRunMyDocObjectsAndRoles.xml b/bt5/erp5_configurator_run_my_doc/SkinTemplateItem/portal_skins/erp5_configurator_run_my_doc/BusinessConfiguration_reindexRunMyDocObjectsAndRoles.xml index 867a9a3f6ef17b26575f7fd2e3a057a9dc972a46..e46a5ab17559b3fc477e19afa70125831b81d662 100644 --- a/bt5/erp5_configurator_run_my_doc/SkinTemplateItem/portal_skins/erp5_configurator_run_my_doc/BusinessConfiguration_reindexRunMyDocObjectsAndRoles.xml +++ b/bt5/erp5_configurator_run_my_doc/SkinTemplateItem/portal_skins/erp5_configurator_run_my_doc/BusinessConfiguration_reindexRunMyDocObjectsAndRoles.xml @@ -51,20 +51,20 @@ <item> <key> <string>_body</string> </key> <value> <string>""" This script reindex all the objects created before updating local roles """\n -module_list = [\'document\',\n - \'image\',\n - \'knowledge_pad\',\n - \'organisation\',\n - \'person\',\n - \'review\',\n - \'test_page\',\n - \'web_page\',\n - \'web_site\']\n +module_list = [\'document_module\',\n + \'image_module\',\n + \'knowledge_pad_module\',\n + \'organisation_module\',\n + \'person_module\',\n + \'review_module\',\n + \'test_page_module\',\n + \'web_page_module\',\n + \'web_site_module\']\n \n context.portal_types.recursiveImmediateReindexObject()\n -for module_content_name in module_list:\n - module_name = module_content_name + \'_module\'\n - module = context.restrictedTraverse(\'erp5/\' + module_name) \n +portal = context.getPortalObject()\n +for module_id in module_list:\n + module = getattr(portal, module_id)\n module.recursiveImmediateReindexObject()\n stack = [module]\n for obj in stack:\n diff --git a/bt5/erp5_configurator_run_my_doc/TestTemplateItem/testRunMyDocConfigurationWorkflow.py b/bt5/erp5_configurator_run_my_doc/TestTemplateItem/testRunMyDocConfigurationWorkflow.py index 39e76a62b42a689db4c8cb87e5c6b1562e007f87..20728651f1a9ab5c95fe68d572747fff5523e779 100644 --- a/bt5/erp5_configurator_run_my_doc/TestTemplateItem/testRunMyDocConfigurationWorkflow.py +++ b/bt5/erp5_configurator_run_my_doc/TestTemplateItem/testRunMyDocConfigurationWorkflow.py @@ -26,10 +26,12 @@ # ############################################################################## -from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase +from Products.ERP5Type.tests.ERP5TypeTestCase import _getConversionServerDict from Products.ERP5Type.tests.Sequence import SequenceList +from Products.ERP5Configurator.tests.ConfiguratorTestMixin import \ + TestLiveConfiguratorWorkflowMixin -class TestRunMyDocsConfiguratorWorkflowMixin(ERP5TypeTestCase): +class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin): """ Test RunMyDocs Configuration Workflow Mixin. """ @@ -80,25 +82,15 @@ class TestRunMyDocsConfiguratorWorkflowMixin(ERP5TypeTestCase): stepCheckSystemPreferenceAfterInstallation stepCheckUserPreferenceAfterInstallation stepCheckKnowledgePadRole - stepCheckCreateNewEvent """ def getBusinessTemplateList(self): return ('erp5_core_proxy_field_legacy', - 'erp5_full_text_myisam_catalog', - 'erp5_base', - 'erp5_workflow', - 'erp5_configurator', - 'erp5_configurator_run_my_doc',) - - def afterSetUp(self): - self.portal.portal_templates.updateRepositoryBusinessTemplateList( - ['http://www.erp5.org/dists/snapshot/bt5/']) - preference = self.portal.portal_preferences.newContent(portal_type="System Preference") - preference.setTitle("global_system_preference") - preference.setPreferredOoodocServerAddress("localhost") - preference.setPreferredOoodocServerPortNumber(8011) - preference.enable() + 'erp5_full_text_myisam_catalog', + 'erp5_base', + 'erp5_workflow', + 'erp5_configurator', + 'erp5_configurator_run_my_doc',) def stepCreateBusinessConfiguration(self, sequence=None, sequence_list=None, **kw): """ Create one Business Configuration """ @@ -114,47 +106,7 @@ class TestRunMyDocsConfiguratorWorkflowMixin(ERP5TypeTestCase): """ Set RunMyDocs Workflow into Business Configuration """ business_configuration = sequence.get("business_configuration") self.setBusinessConfigurationWorkflow(business_configuration, - "workflow_module/runmydocs_configuration_workflow") - - def assertCurrentStep(self, step_title, server_response): - """ Checks the current step title. """ - self.assertTrue( - '<h2>%s</h2>' % step_title in server_response['data'], - 'Unable to guess current step title (expected:%s) in: \n%s' % - (step_title, server_response)) - - def stepConfiguratorNext(self, sequence=None, sequence_list=None, **kw): - """ Go Next into Configuration """ - business_configuration = sequence.get("business_configuration") - next_dict = sequence.get("next_dict") - response_dict = self.portal.portal_configurator._next( - business_configuration, next_dict) - sequence.edit(response_dict=response_dict) - - def setBusinessConfigurationWorkflow(self, business_configuration, workflow): - """ Set configurator workflow """ - business_configuration.setResource(workflow) - - def stepCheckBT5ConfiguratorItem(self, sequence=None, sequence_list=None, **kw): - """ Check if the Configuration Item list is correct """ - business_configuration = sequence.get("business_configuration") - # second one: install some standard business templates - standard_bt5_config_save = business_configuration['1'] - self.assertEquals(len(self.standard_bt5_list), - len(standard_bt5_config_save.contentValues( - portal_type='Standard BT5 Configurator Item'))) - self.assertEquals( - set(self.standard_bt5_list), - set([x.bt5_id for x in standard_bt5_config_save.contentValues()])) - - def stepCheckConfigureOrganisationForm(self, sequence=None, sequence_list=None, **kw): - """ Check if Confire Configure step was showed """ - response_dict = sequence.get("response_dict") - if 'command' in response_dict: - self.assertEquals('show', response_dict['command']) - self.assertEquals(None, response_dict['previous']) - self.assertEquals('Configure Organisation', response_dict['next']) - self.assertCurrentStep('Your Organisation', response_dict) + "workflow_module/run_my_doc_configuration_workflow") def stepSetupOrganisationConfiguratorItem(self, sequence=None, sequence_list=None, **kw): """ Create one Organisation with Basic information """ @@ -166,15 +118,6 @@ class TestRunMyDocsConfiguratorWorkflowMixin(ERP5TypeTestCase): field_your_default_address_zip_code='59000') sequence.edit(next_dict=next_dict) - def stepCheckConfigureUserAccountNumberForm(self, sequence=None, sequence_list=None, **kw): - """ """ - response_dict = sequence.get("response_dict") - if 'command' in response_dict: - self.assertEquals('show', response_dict['command']) - self.assertEquals('Configure user accounts number', response_dict['next']) - self.assertEquals('Previous', response_dict['previous']) - self.assertCurrentStep('Number of user accounts', response_dict) - def stepCheckOrganisationConfiguratorItem(self, sequence=None, sequence_list=None, **kw): """ Check if organisation was created fine """ business_configuration = sequence.get("business_configuration") @@ -193,15 +136,6 @@ class TestRunMyDocsConfiguratorWorkflowMixin(ERP5TypeTestCase): next_dict = dict(field_your_user_number="3") sequence.edit(next_dict=next_dict) - def stepCheckConfigureMultipleUserAccountForm(self, sequence=None, sequence_list=None, **kw): - """ Check the multiple user account form """ - response_dict = sequence.get("response_dict") - if 'command' in response_dict: - self.assertEquals('show', response_dict['command']) - self.assertEquals('Previous', response_dict['previous']) - self.assertEquals('Configure user accounts', response_dict['next']) - self.assertCurrentStep('Configuration of users', response_dict) - def _stepSetupMultipleUserAccountThree(self, sequence, user_list): """ Generic step to create multiple user account """ next_dict = {} @@ -217,7 +151,7 @@ class TestRunMyDocsConfiguratorWorkflowMixin(ERP5TypeTestCase): self.assertEquals('show', response_dict['command']) self.assertEquals('Previous', response_dict['previous']) self.assertEquals('Configure ERP5 Preferences', response_dict['next']) - self.assertCurrentStep('RunMyDocs Preferences', response_dict) + self.assertCurrentStep('RunMyDoc Preferences', response_dict) def stepSetupPreferenceConfigurationBrazil(self, sequence=None, sequence_list=None, **kw): """ Setup the Brazil preference configuration """ @@ -235,13 +169,6 @@ class TestRunMyDocsConfiguratorWorkflowMixin(ERP5TypeTestCase): default_field_your_lang=1) sequence.edit(next_dict=next_dict) - def stepCheckConfigureWebSiteForm(self, sequence=None, sequence_list=None, **kw): - """ Check the installation form """ - response_dict = sequence.get("response_dict") - self.assertEquals('show', response_dict['command']) - self.assertEquals('Previous', response_dict['previous']) - self.assertEquals('Install', response_dict['next']) - def stepCheckMultipleUserAccountThreeBrazil(self, sequence=None, sequence_list=None, **kw): """ Check if the users were created correctly """ business_configuration = sequence.get("business_configuration") @@ -264,31 +191,14 @@ class TestRunMyDocsConfiguratorWorkflowMixin(ERP5TypeTestCase): person_config_item = person_config_save["3"] self.assertEquals(person_config_item.getReference(), "french_assignor") - def stepCheckConfigureInstallationForm(self, sequence=None, sequence_list=None, **kw): - """ Check the installation form """ - response_dict = sequence.get("response_dict") - self.assertEquals('show', response_dict['command']) - - def stepSetupInstallConfiguration(self, sequence=None, sequence_list=None, **kw): - """ Install the Configuration """ - sequence.edit(next_dict={}) - - def stepCheckInstallConfiguration(self, sequence=None, sequence_list=None, **kw): - """ Check the installation of the configuration """ - response_dict = sequence.get("response_dict") - self.assertEquals('install', response_dict['command']) - - def stepStartConfigurationInstallation(self, sequence=None, sequence_list=None, **kw): - """ Starts the installation """ - business_configuration = sequence.get("business_configuration") - self.portal.portal_configurator.startInstallation( - business_configuration, REQUEST=self.portal.REQUEST) - def stepCheckSystemPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw): """ Check System Preference""" system_preference = self.portal.portal_catalog.getResultValue(portal_type="System Preference") - self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), 8011) - self.assertEquals(system_preference.getPreferredOoodocServerAddress(), "localhost") + conversion_dict = _getConversionServerDict() + self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), + conversion_dict['port']) + self.assertEquals(system_preference.getPreferredOoodocServerAddress(), + conversion_dict['hostname']) def stepCheckUserPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw): """ Check System Preference""" @@ -302,50 +212,22 @@ class TestRunMyDocsConfiguratorWorkflowMixin(ERP5TypeTestCase): preference = portal_catalog.getResultValue(portal_type="Preference", title='Preference for Person Creator') self.assertEquals(preference.getPreferenceState(), "enabled") - runmydocs_preference = self.portal.portal_preferences.runmydocs_preference - self.assertEquals(runmydocs_preference.getPreferenceState(), "global") def _stepCheckKnowledgePadRole(self): """ Check if Knowledge Pad is configured correctly """ - pad = self.portal.knowledge_pad_module.newContent(portal_type="Knowledge Pad") - #pad.edit(publication_section_value=self.portal.web_site_module.runmydocs) - pad.visible() - self.stepTic() - gadget = self.portal.portal_gadgets.searchFolder()[0] - gadget_id = gadget.getId() - #self.portal.web_site_module.runmydocs.WebSection_addGadgetList(gadget_id) + self.portal.ERP5Site_createDefaultKnowledgePadListForUser() self.stepTic() - box_list = pad.contentValues() - self.assertEquals(len(box_list), 1) - knowledge_box = box_list[0] - #self.assertEquals(pad.getPublicationSection(), 'web_site_module/runmydocs') - self.assertTrue(knowledge_box.getSpecialiseValue().getId() == gadget_id) - - def _stepCheckCreateNewEvent(self): - """ """ - portal = self.portal - event_dict = dict(portal_type="Note", - title="Buy Phone", - event_text_content="testRunMyDocs Sample", - start_date_hour=11, - start_date_minute=12, - start_date_day=12, - start_date_month=02, - start_date_year=2011, - stop_date_hour=12, - stop_date_minute=12, - stop_date_day=13, - stop_date_month=02, - stop_date_year=2011) - portal.REQUEST.form.update(event_dict) - portal.event_module.EventModule_createNewEvent() + current_user = self.portal.portal_membership.getAuthenticatedMember().getUserName() + pad = self.portal.portal_catalog.getResultValue(portal_type="Knowledge Pad", + owner=current_user) + gadget_uid = self.portal.portal_gadgets.test_wizard_gadget.getUid() + self.portal.KnowledgePad_addBoxList(uids=[gadget_uid], + active_pad_relative_url=pad.getRelativeUrl()) self.stepTic() - event = portal.portal_catalog.getResultValue(portal_type="Note") - self.assertEquals(event.getDescription(), "testRunMyDocs Sample") - start_date = event.getStartDate() - self.assertEquals(start_date.month(), 2) - self.assertEquals(start_date.minute(), 12) - + self.assertEquals(len(pad.contentValues()), 1) + box = pad.contentValues()[0] + self.assertEquals(box.getValidationState(), 'visible') + self.assertEquals(box.getSpecialise(), 'portal_gadgets/test_wizard_gadget') class TestRunMyDocsConfiguratorWorkflowFranceLanguage(TestRunMyDocsConfiguratorWorkflowMixin): """ @@ -394,9 +276,6 @@ class TestRunMyDocsConfiguratorWorkflowFranceLanguage(TestRunMyDocsConfiguratorW self.login("french_creator") self._stepCheckKnowledgePadRole() - def stepCheckCreateNewEvent(self, sequence=None, sequence_list=None, **kw): - self.login("french_assignee") - self._stepCheckCreateNewEvent() class TestRunMyDocsConfiguratorWorkflowBrazilLanguage(TestRunMyDocsConfiguratorWorkflowMixin): @@ -445,7 +324,3 @@ class TestRunMyDocsConfiguratorWorkflowBrazilLanguage(TestRunMyDocsConfiguratorW def stepCheckKnowledgePadRole(self, sequence=None, sequence_list=None, **kw): self.login("person_creator") self._stepCheckKnowledgePadRole() - - def stepCheckCreateNewEvent(self, sequence=None, sequence_list=None, **kw): - self.login("person_assignee") - self._stepCheckCreateNewEvent() diff --git a/bt5/erp5_configurator_ung/PathTemplateItem/workflow_module/ung_configuration_workflow/8.xml b/bt5/erp5_configurator_ung/PathTemplateItem/workflow_module/ung_configuration_workflow/8.xml index 391e3ddae71f0176ab41f7242a924ffa2451a463..acd269d5222a8e934a9de8a8f74dd492c44556fd 100644 --- a/bt5/erp5_configurator_ung/PathTemplateItem/workflow_module/ung_configuration_workflow/8.xml +++ b/bt5/erp5_configurator_ung/PathTemplateItem/workflow_module/ung_configuration_workflow/8.xml @@ -69,7 +69,7 @@ nter Number of User</string> </value> </item> <item> <key> <string>title</string> </key> - <value> <string>Your Organisation</string> </value> + <value> <string>Your organisation</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_configurator_ung/PathTemplateItem/workflow_module/ung_configuration_workflow/9.xml b/bt5/erp5_configurator_ung/PathTemplateItem/workflow_module/ung_configuration_workflow/9.xml index a94571d910a796c2fe3bfc3cd6174c3034ba1834..65b6ef5f0c46ca1f2337b894c9d20904a424fade 100644 --- a/bt5/erp5_configurator_ung/PathTemplateItem/workflow_module/ung_configuration_workflow/9.xml +++ b/bt5/erp5_configurator_ung/PathTemplateItem/workflow_module/ung_configuration_workflow/9.xml @@ -69,7 +69,7 @@ </item> <item> <key> <string>title</string> </key> - <value> <string>Configuration of users</string> </value> + <value> <string>User accounts configuration</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_configurator_ung/TestTemplateItem/testUNGConfigurationWorkflow.py b/bt5/erp5_configurator_ung/TestTemplateItem/testUNGConfigurationWorkflow.py index 070a80def5415947e74598bd697a67e99c899d7e..dc070d641e993d9da48c26c2638beb85bdacd0c0 100644 --- a/bt5/erp5_configurator_ung/TestTemplateItem/testUNGConfigurationWorkflow.py +++ b/bt5/erp5_configurator_ung/TestTemplateItem/testUNGConfigurationWorkflow.py @@ -25,10 +25,12 @@ # ############################################################################## -from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase +from Products.ERP5Type.tests.ERP5TypeTestCase import _getConversionServerDict from Products.ERP5Type.tests.Sequence import SequenceList +from Products.ERP5Configurator.tests.ConfiguratorTestMixin import \ + TestLiveConfiguratorWorkflowMixin -class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): +class TestUNGConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin): """ Test UNG Configuration Workflow Mixin. """ @@ -104,20 +106,11 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): def getBusinessTemplateList(self): return ('erp5_core_proxy_field_legacy', - 'erp5_full_text_myisam_catalog', - 'erp5_base', - 'erp5_workflow', - 'erp5_configurator', - 'erp5_configurator_ung',) - - def afterSetUp(self): - self.portal.portal_templates.updateRepositoryBusinessTemplateList( - ['http://www.erp5.org/dists/snapshot/bt5/']) - preference = self.portal.portal_preferences.newContent(portal_type="System Preference") - preference.setTitle("global_system_preference") - preference.setPreferredOoodocServerAddress("localhost") - preference.setPreferredOoodocServerPortNumber(8011) - preference.enable() + 'erp5_full_text_myisam_catalog', + 'erp5_base', + 'erp5_workflow', + 'erp5_configurator', + 'erp5_configurator_ung',) def stepCreateBusinessConfiguration(self, sequence=None, sequence_list=None, **kw): """ Create one Business Configuration """ @@ -135,46 +128,6 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): self.setBusinessConfigurationWorkflow(business_configuration, "workflow_module/ung_configuration_workflow") - def assertCurrentStep(self, step_title, server_response): - """ Checks the current step title. """ - self.assertTrue( - '<h2>%s</h2>' % step_title in server_response['data'], - 'Unable to guess current step title (expected:%s) in: \n%s' % - (step_title, server_response)) - - def stepConfiguratorNext(self, sequence=None, sequence_list=None, **kw): - """ Go Next into Configuration """ - business_configuration = sequence.get("business_configuration") - next_dict = sequence.get("next_dict") - response_dict = self.portal.portal_configurator._next( - business_configuration, next_dict) - sequence.edit(response_dict=response_dict) - - def setBusinessConfigurationWorkflow(self, business_configuration, workflow): - """ Set configurator workflow """ - business_configuration.setResource(workflow) - - def stepCheckBT5ConfiguratorItem(self, sequence=None, sequence_list=None, **kw): - """ Check if the Configuration Item list is correct """ - business_configuration = sequence.get("business_configuration") - # second one: install some standard business templates - standard_bt5_config_save = business_configuration['1'] - self.assertEquals(len(self.standard_bt5_list), - len(standard_bt5_config_save.contentValues( - portal_type='Standard BT5 Configurator Item'))) - self.assertEquals( - set(self.standard_bt5_list), - set([x.bt5_id for x in standard_bt5_config_save.contentValues()])) - - def stepCheckConfigureOrganisationForm(self, sequence=None, sequence_list=None, **kw): - """ Check if Confire Configure step was showed """ - response_dict = sequence.get("response_dict") - if 'command' in response_dict: - self.assertEquals('show', response_dict['command']) - self.assertEquals(None, response_dict['previous']) - self.assertEquals('Configure Organisation', response_dict['next']) - self.assertCurrentStep('Your Organisation', response_dict) - def stepSetupOrganisationConfiguratorItem(self, sequence=None, sequence_list=None, **kw): """ Create one Organisation with Basic information """ next_dict = dict( @@ -185,14 +138,6 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): field_your_default_address_zip_code='59000') sequence.edit(next_dict=next_dict) - def stepCheckConfigureUserAccountNumberForm(self, sequence=None, sequence_list=None, **kw): - """ """ - response_dict = sequence.get("response_dict") - if 'command' in response_dict: - self.assertEquals('show', response_dict['command']) - self.assertEquals('Configure user accounts number', response_dict['next']) - self.assertEquals('Previous', response_dict['previous']) - self.assertCurrentStep('Number of user accounts', response_dict) def stepCheckOrganisationConfiguratorItem(self, sequence=None, sequence_list=None, **kw): """ Check if organisation was created fine """ @@ -212,15 +157,6 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): next_dict = dict(field_your_user_number="3") sequence.edit(next_dict=next_dict) - def stepCheckConfigureMultipleUserAccountForm(self, sequence=None, sequence_list=None, **kw): - """ Check the multiple user account form """ - response_dict = sequence.get("response_dict") - if 'command' in response_dict: - self.assertEquals('show', response_dict['command']) - self.assertEquals('Previous', response_dict['previous']) - self.assertEquals('Configure user accounts', response_dict['next']) - self.assertCurrentStep('Configuration of users', response_dict) - def _stepSetupMultipleUserAccountThree(self, sequence, user_list): """ Generic step to create multiple user account """ next_dict = {} @@ -230,7 +166,7 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): sequence.edit(next_dict=next_dict) def stepCheckConfigurePreferenceForm(self, sequence=None, sequence_list=None, **kw): - """ Check the multiple user account form """ + """ Check the preference form """ response_dict = sequence.get("response_dict") if 'command' in response_dict: self.assertEquals('show', response_dict['command']) @@ -254,13 +190,6 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): default_field_your_lang=1) sequence.edit(next_dict=next_dict) - def stepCheckConfigureWebSiteForm(self, sequence=None, sequence_list=None, **kw): - """ Check the installation form """ - response_dict = sequence.get("response_dict") - self.assertEquals('show', response_dict['command']) - self.assertEquals('Previous', response_dict['previous']) - self.assertEquals('Install', response_dict['next']) - def stepCheckMultipleUserAccountThreeBrazil(self, sequence=None, sequence_list=None, **kw): """ Check if the users were created correctly """ business_configuration = sequence.get("business_configuration") @@ -288,26 +217,14 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): response_dict = sequence.get("response_dict") self.assertEquals('show', response_dict['command']) - def stepSetupInstallConfiguration(self, sequence=None, sequence_list=None, **kw): - """ Install the Configuration """ - sequence.edit(next_dict={}) - - def stepCheckInstallConfiguration(self, sequence=None, sequence_list=None, **kw): - """ Check the installation of the configuration """ - response_dict = sequence.get("response_dict") - self.assertEquals('install', response_dict['command']) - - def stepStartConfigurationInstallation(self, sequence=None, sequence_list=None, **kw): - """ Starts the installation """ - business_configuration = sequence.get("business_configuration") - self.portal.portal_configurator.startInstallation( - business_configuration, REQUEST=self.portal.REQUEST) - def stepCheckSystemPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw): """ Check System Preference""" system_preference = self.portal.portal_catalog.getResultValue(portal_type="System Preference") - self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), 8011) - self.assertEquals(system_preference.getPreferredOoodocServerAddress(), "localhost") + conversion_dict = _getConversionServerDict() + self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), + conversion_dict['port']) + self.assertEquals(system_preference.getPreferredOoodocServerAddress(), + conversion_dict['hostname']) def stepCheckUserPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw): """ Check System Preference""" @@ -321,8 +238,8 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): preference = portal_catalog.getResultValue(portal_type="Preference", title='Preference for Person Creator') self.assertEquals(preference.getPreferenceState(), "enabled") - ung_preference = self.portal.portal_preferences.ung_preference - self.assertEquals(ung_preference.getPreferenceState(), "global") + preference = self.portal.portal_preferences.ung_preference + self.assertEquals(preference.getPreferenceState(), "global") def _stepCheckWebSiteRoles(self): """ Check permission of Web Site with normal user """ diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/datetime_field_zuite/testSurchargeWithInvalidDateTime.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/datetime_field_zuite/testSurchargeWithInvalidDateTime.xml index 4a8c413309ad3cef62e0e6bc4540b49feed12647..a3e06eea1e578a31cc90193e2622ff35c1f545fc 100644 --- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/datetime_field_zuite/testSurchargeWithInvalidDateTime.xml +++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/datetime_field_zuite/testSurchargeWithInvalidDateTime.xml @@ -180,16 +180,14 @@ <td></td>\n </tr>\n <tr>\n - <td>assertPortalStatusMessage</td>\n + <td>assertText</td>\n + <td>//div[@class="status"]/div[@class="transition_message"]</td>\n <td>Data updated.</td>\n - <td></td>\n </tr>\n \n </tbody></table>\n </body>\n -</html>\n -\n - +</html> ]]></unicode> </value> </item> diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/matrixbox_zuite/testDynamicCreateCell.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/matrixbox_zuite/testDynamicCreateCell.xml index cd60ed9cec2ad0edd438365c1f0beec14f74b086..ba4544402d7ab6777360a28ec8d10a4de1eba4d8 100644 --- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/matrixbox_zuite/testDynamicCreateCell.xml +++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/matrixbox_zuite/testDynamicCreateCell.xml @@ -206,7 +206,7 @@ </tr>\n <tr>\n <td>verifyTextPresent</td>\n - <td>[\'c\', \'three\']</td>\n + <td>[\'c\', \'four\']</td>\n <td></td>\n </tr>\n <tr>\n @@ -216,7 +216,7 @@ </tr>\n <tr>\n <td>verifyTextPresent</td>\n - <td>[\'c\', \'four\']</td>\n + <td>[\'c\', \'three\']</td>\n <td></td>\n </tr>\n \n @@ -248,8 +248,7 @@ The field must be in the \'bottom\' group for this to work.\n </tbody>\n </table>\n </body>\n -</html>\n - +</html> ]]></unicode> </value> </item> diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/planning_box_field_zuite/testPlanningBoxBlockPosition.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/planning_box_field_zuite/testPlanningBoxBlockPosition.xml index b1fa1c0503ce5f6d865ba27abca24d8ea64c7dd7..0fcc3630a3a87706afb6eb8817749c2fd56ea136 100644 --- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/planning_box_field_zuite/testPlanningBoxBlockPosition.xml +++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/planning_box_field_zuite/testPlanningBoxBlockPosition.xml @@ -179,17 +179,17 @@ <tr>\n <td>verifyElementPositionTop</td>\n <td>id=group_1_activity_1_block_1</td>\n - <td>250</td>\n + <td>251</td>\n </tr>\n <tr>\n <td>verifyElementPositionTop</td>\n <td>id=group_2_activity_1_block_1</td>\n - <td>330</td>\n + <td>331</td>\n </tr>\n <tr>\n <td>verifyElementPositionTop</td>\n <td>id=group_3_activity_1_block_1</td>\n - <td>410</td>\n + <td>411</td>\n </tr>\n <tr>\n <td>verifyElementWidth</td>\n @@ -225,9 +225,7 @@ \n </tbody></table>\n </body>\n -</html>\n -\n - +</html> ]]></unicode> </value> </item> diff --git a/bt5/erp5_ui_test/bt/revision b/bt5/erp5_ui_test/bt/revision index 8ec1add553090eb8d2035c82e29e1a1992832ac0..633a07769901eb809dc5c81a7130887878624251 100644 --- a/bt5/erp5_ui_test/bt/revision +++ b/bt5/erp5_ui_test/bt/revision @@ -1 +1 @@ -683 +685 \ No newline at end of file diff --git a/product/ERP5Configurator/tests/ConfiguratorTestMixin.py b/product/ERP5Configurator/tests/ConfiguratorTestMixin.py index e1a3f00d795aeb7249b3b8ecda551bffa37791d6..bd2afa04071f7f971415023345c557125f2ebf91 100644 --- a/product/ERP5Configurator/tests/ConfiguratorTestMixin.py +++ b/product/ERP5Configurator/tests/ConfiguratorTestMixin.py @@ -133,13 +133,26 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): # it is required by SecurityTestCase self.workflow_tool = self.portal.portal_workflow self.setDefaultSitePreference() + self.setSystemPreference() self.portal.portal_activities.unsubscribe() + def setSystemPreference(self): + portal_type = 'System Preference' + preference_list = self.portal.portal_preferences.contentValues( + portal_type=portal_type) + if not preference_list: + preference = self.portal.portal_preferences.newContent( + portal_type=portal_type) + else: + preference = preference_list[0] + conversion_dict = _getConversionServerDict() + preference.setPreferredOoodocServerAddress(conversion_dict['hostname']) + preference.setPreferredOoodocServerPortNumber(conversion_dict['port']) + if self.portal.portal_workflow.isTransitionPossible(preference, 'enable'): + preference.enable() + def setDefaultSitePreference(self): default_pref = self.portal.portal_preferences.default_site_preference - conversion_dict = _getConversionServerDict() - default_pref.setPreferredOoodocServerAddress(conversion_dict['hostname']) - default_pref.setPreferredOoodocServerPortNumber(conversion_dict['port']) if self.portal.portal_workflow.isTransitionPossible(default_pref, 'enable'): default_pref.enable() return default_pref @@ -172,7 +185,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): response_dict = self.portal.portal_configurator._next( business_configuration, next_dict) sequence.edit(response_dict=response_dict) - + def stepConfiguratorPrevious(self, sequence=None, sequence_list=None, **kw): """ Go to the previous form. """ business_configuration = sequence.get("business_configuration") @@ -477,8 +490,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): def stepSetupInstallConfiguration(self, sequence=None, sequence_list=None, **kw): """ Install the Configuration """ - next_dict = {} - sequence.edit(next_dict=next_dict) + sequence.edit(next_dict={}) def stepCheckInstallConfiguration(self, sequence=None, sequence_list=None, **kw): """ Check the installation of the configuration """ diff --git a/product/ERP5Type/ERP5Type.py b/product/ERP5Type/ERP5Type.py index 9d960df38944a2aef0b90bc5c73dc746014b4639..a601fd8241208598dd59aefe21e11d361195812f 100644 --- a/product/ERP5Type/ERP5Type.py +++ b/product/ERP5Type/ERP5Type.py @@ -45,6 +45,7 @@ ERP5TYPE_SECURITY_GROUP_ID_GENERATION_SCRIPT = 'ERP5Type_asSecurityGroupId' from TranslationProviderBase import TranslationProviderBase from sys import exc_info +from types import StringType from zLOG import LOG, ERROR from Products.CMFCore.exceptions import zExceptions_Unauthorized @@ -521,10 +522,20 @@ class ERP5TypeInformation(XMLObject, ob = self.constructTempInstance(self, self.getId()) property_list = list(getattr(ob.__class__, '_properties', [])) self.updatePropertySheetDefinitionDict({'_properties': property_list}) - for property_sheet in getClassPropertyList(ob.__class__): - property_list += getattr(property_sheet, '_properties', () ) - return_set = set() + class_property_list = list(getClassPropertyList(ob.__class__)) + for property_sheet in ob.getTypePropertySheetList(): + if property_sheet not in class_property_list: + class_property_list.append(property_sheet) + for property_sheet in iter(class_property_list): + property_sheet_tool = self.getPortalObject().portal_property_sheets + if type(property_sheet) == StringType: + property_sheet_obj = property_sheet_tool[property_sheet] + for property in property_sheet_obj.contentValues(): + return_set.add(property.getTitle()) + else: + property_list += getattr(property_sheet, '_properties', () ) + for property in property_list: if property['type'] == 'content': for suffix in property['acquired_property_id']: diff --git a/product/ERP5Type/tests/testERP5Type.py b/product/ERP5Type/tests/testERP5Type.py index 3b6f918e78dde627672af41cf28d166783b859ee..08b075749a8d84d1f94f20a359183b4059c8a989 100644 --- a/product/ERP5Type/tests/testERP5Type.py +++ b/product/ERP5Type/tests/testERP5Type.py @@ -3093,6 +3093,17 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): self.assertEquals(None, person.getProperty('foo_property')) self.assertEquals(None, person.getProperty('foobar_property')) + def testgetInstancePropertyAndBaseCategoryList(self): + """ + Check that the method getInstancePropertyAndBaseCategoryList return + properties from property sheets correctly + """ + portal_type = self.portal.portal_types.Email + result_list = portal_type.getInstancePropertyAndBaseCategoryList() + self.assertTrue("description" in result_list, + "description not in %s" % result_list) + + class TestAccessControl(ERP5TypeTestCase): # Isolate test in a dedicaced class in order not to break other tests # when this one fails.