Commit 8f9b71f1 authored by Gabriel Monnerat's avatar Gabriel Monnerat

add step to remove code duplicated and clean up the code

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45029 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc2cd9ec
......@@ -79,7 +79,7 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
stepConfiguratorNext
stepTic
stepCheckConfigureMultipleUserAccountForm
stepSetupMultipleUserAccountThree%(country)s
stepSetupMultipleUserAccountThree
stepConfiguratorNext
stepTic
stepCheckConfigurePreferenceForm
......@@ -99,6 +99,7 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
stepStartConfigurationInstallation
stepTic
stepCheckUNGWebSiteAfterInstallation
stepCheckSystemPreferenceAfterInstallation
"""
def getBusinessTemplateList(self):
......@@ -223,68 +224,6 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
next_dict.setdefault(k, []).append(v)
sequence.edit(next_dict=next_dict)
def stepSetupMultipleUserAccountThreeBrazil(self, sequence=None, sequence_list=None, **kw):
""" Create multiple user account """
user_list = [
dict(
field_your_first_name='Person',
field_your_last_name='Creator',
field_your_reference="person_creator",
field_your_password='person_creator',
field_your_password_confirm='person_creator',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
), dict(
field_your_first_name='Person',
field_your_last_name='Assignee',
field_your_reference="person_assignee",
field_your_password='person_assignee',
field_your_password_confirm='person_assignee',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
), dict(
field_your_first_name='Person',
field_your_last_name='Assignor',
field_your_reference="person_assignor",
field_your_password='person_assignor',
field_your_password_confirm='person_assignor',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
),
]
self._stepSetupMultipleUserAccountThree(sequence, user_list)
def stepSetupMultipleUserAccountThreeFrance(self, sequence=None, sequence_list=None, **kw):
""" Create multiple user account """
user_list = [
dict(
field_your_first_name='Person',
field_your_last_name='Creator',
field_your_reference="french_creator",
field_your_password='person_creator',
field_your_password_confirm='person_creator',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
), dict(
field_your_first_name='Person',
field_your_last_name='Assignee',
field_your_reference="french_assignee",
field_your_password='person_assignee',
field_your_password_confirm='person_assignee',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
), dict(
field_your_first_name='Person',
field_your_last_name='Assignor',
field_your_reference="french_assignor",
field_your_password='person_assignor',
field_your_password_confirm='person_assignor',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
),
]
self._stepSetupMultipleUserAccountThree(sequence, user_list)
def stepCheckConfigurePreferenceForm(self, sequence=None, sequence_list=None, **kw):
""" Check the multiple user account form """
response_dict = sequence.get("response_dict")
......@@ -310,11 +249,9 @@ 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")
# configuration is finished. We are at the Install state.
self.assertEquals('show', response_dict['command'])
self.assertEquals('Previous', response_dict['previous'])
self.assertEquals('Configure Web Site', response_dict['next'])
......@@ -363,6 +300,12 @@ class TestUNGConfiguratorWorkflowMixin(ERP5TypeTestCase):
self.portal.portal_configurator.startInstallation(
business_configuration, REQUEST=self.portal.REQUEST)
def stepCheckUNGWebSiteAfterInstallation(self, sequence=None, sequence_list=None, **kw):
""" Check System Preference"""
system_preference = portal_catalog.getResultValue(portal_type="System Preference")
self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), 8011)
self.assertEquals(system_preference.getPreferredOoodocServerAddress(), "localhost")
class TestUNGConfiguratorWorkflowFranceLanguage(TestUNGConfiguratorWorkflowMixin):
"""
......@@ -376,6 +319,37 @@ class TestUNGConfiguratorWorkflowFranceLanguage(TestUNGConfiguratorWorkflowMixin
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def stepSetupMultipleUserAccountThree(self, sequence=None, sequence_list=None, **kw):
""" Create multiple user account """
user_list = [
dict(
field_your_first_name='Person',
field_your_last_name='Creator',
field_your_reference="french_creator",
field_your_password='person_creator',
field_your_password_confirm='person_creator',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
), dict(
field_your_first_name='Person',
field_your_last_name='Assignee',
field_your_reference="french_assignee",
field_your_password='person_assignee',
field_your_password_confirm='person_assignee',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
), dict(
field_your_first_name='Person',
field_your_last_name='Assignor',
field_your_reference="french_assignor",
field_your_password='person_assignor',
field_your_password_confirm='person_assignor',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
),
]
self._stepSetupMultipleUserAccountThree(sequence, user_list)
def stepSetupWebSiteConfiguration(self, sequence=None, sequence_list=None, **kw):
""" Setup Web Site """
next_dict = dict(your_default_available_language="fr")
......@@ -413,9 +387,6 @@ class TestUNGConfiguratorWorkflowFranceLanguage(TestUNGConfiguratorWorkflowMixin
assignment = person.contentValues(portal_type="Assignment")[0]
self.assertEquals(assignment.getValidationState(), "open")
self.assertEquals(assignment.getFunction(), "function/ung_user")
system_preference = portal_catalog.getResultValue(portal_type="System Preference")
self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), 8011)
self.assertEquals(system_preference.getPreferredOoodocServerAddress(), "localhost")
class TestUNGConfiguratorWorkflowBrazilLanguage(TestUNGConfiguratorWorkflowMixin):
"""
......@@ -434,6 +405,37 @@ class TestUNGConfiguratorWorkflowBrazilLanguage(TestUNGConfiguratorWorkflowMixin
next_dict = dict(your_default_available_language="pt-BR")
sequence.edit(next_dict=next_dict)
def stepSetupMultipleUserAccountThree(self, sequence=None, sequence_list=None, **kw):
""" Create multiple user account """
user_list = [
dict(
field_your_first_name='Person',
field_your_last_name='Creator',
field_your_reference="person_creator",
field_your_password='person_creator',
field_your_password_confirm='person_creator',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
), dict(
field_your_first_name='Person',
field_your_last_name='Assignee',
field_your_reference="person_assignee",
field_your_password='person_assignee',
field_your_password_confirm='person_assignee',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
), dict(
field_your_first_name='Person',
field_your_last_name='Assignor',
field_your_reference="person_assignor",
field_your_password='person_assignor',
field_your_password_confirm='person_assignor',
field_your_default_email_text='test@test.com',
field_your_default_telephone_text='',
),
]
self._stepSetupMultipleUserAccountThree(sequence, user_list)
def stepCheckUNGWebSiteAfterInstallation(self, sequence=None, sequence_list=None, **kw):
""" Check if UNG Web Site is published and your language"""
ung_web_site = self.portal.web_site_module.ung
......@@ -466,6 +468,3 @@ class TestUNGConfiguratorWorkflowBrazilLanguage(TestUNGConfiguratorWorkflowMixin
assignment = person.contentValues(portal_type="Assignment")[0]
self.assertEquals(assignment.getValidationState(), "open")
self.assertEquals(assignment.getFunction(), "function/ung_user")
system_preference = portal_catalog.getResultValue(portal_type="System Preference")
self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(), 8011)
self.assertEquals(system_preference.getPreferredOoodocServerAddress(), "localhost")
\ No newline at end of file
30
\ No newline at end of file
31
\ 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