Commit 1a1654f6 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Add step to check if preferences were configured correctly

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45103 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3acf9fe4
...@@ -69,7 +69,7 @@ if ung_web_site is not None and isTransitionPossible(ung_web_site, \'publish\', ...@@ -69,7 +69,7 @@ if ung_web_site is not None and isTransitionPossible(ung_web_site, \'publish\',
ung_web_site.publish()\n ung_web_site.publish()\n
\n \n
language = context.getGlobalConfigurationAttr("default_available_language")\n language = context.getGlobalConfigurationAttr("default_available_language")\n
context.log(language)\n \n
ung_web_site.setDefaultAvailableLanguage(language)\n ung_web_site.setDefaultAvailableLanguage(language)\n
for web_section in ung_web_site.contentValues(portal_types=\'Web Section\'):\n for web_section in ung_web_site.contentValues(portal_types=\'Web Section\'):\n
if isTransitionPossible(web_section, \'publish\', None):\n if isTransitionPossible(web_section, \'publish\', None):\n
......
...@@ -64,7 +64,6 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): ...@@ -64,7 +64,6 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
'erp5_web_ung_role') 'erp5_web_ung_role')
DEFAULT_SEQUENCE_LIST = """ DEFAULT_SEQUENCE_LIST = """
stepSetupConversionServer
stepCreateBusinessConfiguration stepCreateBusinessConfiguration
stepSetUNGWorkflow stepSetUNGWorkflow
stepConfiguratorNext stepConfiguratorNext
...@@ -101,6 +100,8 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): ...@@ -101,6 +100,8 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
stepTic stepTic
stepCheckUNGWebSiteAfterInstallation stepCheckUNGWebSiteAfterInstallation
stepCheckSystemPreferenceAfterInstallation stepCheckSystemPreferenceAfterInstallation
stepCheckUserPreferenceAfterInstallation
stepTic
""" """
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
...@@ -114,13 +115,13 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): ...@@ -114,13 +115,13 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
def afterSetUp(self): def afterSetUp(self):
self.portal.portal_templates.updateRepositoryBusinessTemplateList( self.portal.portal_templates.updateRepositoryBusinessTemplateList(
['http://www.erp5.org/dists/snapshot/bt5/']) ['http://www.erp5.org/dists/snapshot/bt5/'])
if not self.portal.portal_catalog.getResultValue(portal_types="System Preference",
def stepSetupConversionServer(self, sequence=None, sequence_list=None, **kw): title="global_system_preference"):
""" Setup conversion server in portal_preference """ preference = self.portal.portal_preferences.newContent(portal_type="System Preference")
preference = self.portal.portal_preferences.newContent(portal_type="System Preference") preference.setTitle("global_system_preference")
preference.setPreferredOoodocServerAddress("localhost") preference.setPreferredOoodocServerAddress("localhost")
preference.setPreferredOoodocServerPortNumber(8011) preference.setPreferredOoodocServerPortNumber(8011)
preference.enable() preference.enable()
def stepCreateBusinessConfiguration(self, sequence=None, sequence_list=None, **kw): def stepCreateBusinessConfiguration(self, sequence=None, sequence_list=None, **kw):
""" Create one Business Configuration """ """ Create one Business Configuration """
...@@ -310,10 +311,26 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase): ...@@ -310,10 +311,26 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
def stepCheckSystemPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw): def stepCheckSystemPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw):
""" Check System Preference""" """ Check System Preference"""
import ipdb;ipdb.set_trace()
system_preference = self.portal.portal_catalog.getResultValue(portal_type="System Preference") system_preference = self.portal.portal_catalog.getResultValue(portal_type="System Preference")
self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), 8011) self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), 8011)
self.assertEquals(system_preference.getPreferredOoodocServerAddress(), "localhost") self.assertEquals(system_preference.getPreferredOoodocServerAddress(), "localhost")
def stepCheckUserPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw):
""" Check System Preference"""
portal_catalog = portal.portal_catalog
preference = portal_catalog.getResultValue(portal_type="Preference",
reference='Preference for Person Assignor')
self.assertEquals(preference.getPreferenceState(), "enabled")
preference = portal_catalog.getResultValue(portal_type="Preference",
title='Preference for Person Assignee')
self.assertEquals(preference.getPreferenceState(), "enabled")
preference = portal_catalog.getResultValue(portal_type="Preference",
title='Preference for Person Creator')
self.assertEquals(preference.getPreferenceState(), "enabled")
preference = portal_catalog.getResultValue(portal_type="Preference",
id='ung_reference')
self.assertEquals(preference.getPreferenceState(), "enabled")
class TestUNGConfiguratorWorkflowFranceLanguage(TestUNGConfiguratorWorkflowMixin): class TestUNGConfiguratorWorkflowFranceLanguage(TestUNGConfiguratorWorkflowMixin):
""" """
...@@ -396,6 +413,7 @@ class TestUNGConfiguratorWorkflowFranceLanguage(TestUNGConfiguratorWorkflowMixin ...@@ -396,6 +413,7 @@ class TestUNGConfiguratorWorkflowFranceLanguage(TestUNGConfiguratorWorkflowMixin
self.assertEquals(assignment.getValidationState(), "open") self.assertEquals(assignment.getValidationState(), "open")
self.assertEquals(assignment.getFunction(), "function/ung_user") self.assertEquals(assignment.getFunction(), "function/ung_user")
class TestUNGConfiguratorWorkflowBrazilLanguage(TestUNGConfiguratorWorkflowMixin): class TestUNGConfiguratorWorkflowBrazilLanguage(TestUNGConfiguratorWorkflowMixin):
""" """
Test UNG Configuration Workflow Test UNG Configuration Workflow
...@@ -445,7 +463,7 @@ class TestUNGConfiguratorWorkflowBrazilLanguage(TestUNGConfiguratorWorkflowMixin ...@@ -445,7 +463,7 @@ class TestUNGConfiguratorWorkflowBrazilLanguage(TestUNGConfiguratorWorkflowMixin
self._stepSetupMultipleUserAccountThree(sequence, user_list) self._stepSetupMultipleUserAccountThree(sequence, user_list)
def stepCheckUNGWebSiteAfterInstallation(self, sequence=None, sequence_list=None, **kw): def stepCheckUNGWebSiteAfterInstallation(self, sequence=None, sequence_list=None, **kw):
""" Check if UNG Web Site is published and your language""" """ Check if UNG Web Site is published and your language """
ung_web_site = self.portal.web_site_module.ung ung_web_site = self.portal.web_site_module.ung
portal_catalog = self.portal.portal_catalog portal_catalog = self.portal.portal_catalog
self.assertEquals(ung_web_site.getValidationState(), self.assertEquals(ung_web_site.getValidationState(),
......
33 34
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment