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\',
ung_web_site.publish()\n
\n
language = context.getGlobalConfigurationAttr("default_available_language")\n
context.log(language)\n
\n
ung_web_site.setDefaultAvailableLanguage(language)\n
for web_section in ung_web_site.contentValues(portal_types=\'Web Section\'):\n
if isTransitionPossible(web_section, \'publish\', None):\n
......
......@@ -64,7 +64,6 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
'erp5_web_ung_role')
DEFAULT_SEQUENCE_LIST = """
stepSetupConversionServer
stepCreateBusinessConfiguration
stepSetUNGWorkflow
stepConfiguratorNext
......@@ -101,6 +100,8 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
stepTic
stepCheckUNGWebSiteAfterInstallation
stepCheckSystemPreferenceAfterInstallation
stepCheckUserPreferenceAfterInstallation
stepTic
"""
def getBusinessTemplateList(self):
......@@ -114,10 +115,10 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
def afterSetUp(self):
self.portal.portal_templates.updateRepositoryBusinessTemplateList(
['http://www.erp5.org/dists/snapshot/bt5/'])
def stepSetupConversionServer(self, sequence=None, sequence_list=None, **kw):
""" Setup conversion server in portal_preference """
if not self.portal.portal_catalog.getResultValue(portal_types="System Preference",
title="global_system_preference"):
preference = self.portal.portal_preferences.newContent(portal_type="System Preference")
preference.setTitle("global_system_preference")
preference.setPreferredOoodocServerAddress("localhost")
preference.setPreferredOoodocServerPortNumber(8011)
preference.enable()
......@@ -310,10 +311,26 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
def stepCheckSystemPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw):
""" Check System Preference"""
import ipdb;ipdb.set_trace()
system_preference = self.portal.portal_catalog.getResultValue(portal_type="System Preference")
self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), 8011)
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):
"""
......@@ -396,6 +413,7 @@ class TestUNGConfiguratorWorkflowFranceLanguage(TestUNGConfiguratorWorkflowMixin
self.assertEquals(assignment.getValidationState(), "open")
self.assertEquals(assignment.getFunction(), "function/ung_user")
class TestUNGConfiguratorWorkflowBrazilLanguage(TestUNGConfiguratorWorkflowMixin):
"""
Test UNG Configuration Workflow
......@@ -445,7 +463,7 @@ class TestUNGConfiguratorWorkflowBrazilLanguage(TestUNGConfiguratorWorkflowMixin
self._stepSetupMultipleUserAccountThree(sequence, user_list)
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
portal_catalog = self.portal.portal_catalog
self.assertEquals(ung_web_site.getValidationState(),
......
33
\ No newline at end of file
34
\ 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