Commit 9328e966 authored by Rafael Monnerat's avatar Rafael Monnerat

Remove white spaces (pep8)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44266 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 14c81f5b
...@@ -75,7 +75,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -75,7 +75,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
def stepLogin(self, quiet=0, run=1, **kw): def stepLogin(self, quiet=0, run=1, **kw):
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
uf._doAddUser('test_configurator_user', '', uf._doAddUser('test_configurator_user', '',
['Manager', 'Assignee', 'Assignor', ['Manager', 'Assignee', 'Assignor',
'Associate', 'Auditor', 'Author'], []) 'Associate', 'Auditor', 'Author'], [])
user = uf.getUserById('test_configurator_user').__of__(uf) user = uf.getUserById('test_configurator_user').__of__(uf)
...@@ -141,7 +141,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -141,7 +141,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
response_dict = self.portal.portal_configurator._next( response_dict = self.portal.portal_configurator._next(
business_configuration, next_dict) business_configuration, next_dict)
sequence.edit(response_dict=response_dict) sequence.edit(response_dict=response_dict)
def stepConfiguratorPrevious(self, sequence=None, sequence_list=None, **kw): def stepConfiguratorPrevious(self, sequence=None, sequence_list=None, **kw):
""" Go to the previous form. """ """ Go to the previous form. """
business_configuration = sequence.get("business_configuration") business_configuration = sequence.get("business_configuration")
...@@ -222,8 +222,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -222,8 +222,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
sequence.edit(next_dict=next_dict) sequence.edit(next_dict=next_dict)
def stepCheckMultiplePersonConfigurationItem(self, sequence=None, sequence_list=None, **kw): def stepCheckMultiplePersonConfigurationItem(self, sequence=None, sequence_list=None, **kw):
""" """Check if multiple Person Configuration Item of the Business
Check if multiple Person Configuration Item of the Business
Configuration have been created successfully. Configuration have been created successfully.
""" """
business_configuration = sequence.get("business_configuration") business_configuration = sequence.get("business_configuration")
...@@ -241,7 +240,6 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -241,7 +240,6 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
person_business_configuration_save = configuration_save person_business_configuration_save = configuration_save
break break
self.assertEquals(int(self.company_employees_number), self.assertEquals(int(self.company_employees_number),
len(person_business_configuration_save.contentValues())) len(person_business_configuration_save.contentValues()))
return person_business_configuration_save return person_business_configuration_save
...@@ -250,7 +248,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -250,7 +248,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
""" Check the accounting form configuration. """ """ Check the accounting form configuration. """
response_dict = sequence.get("response_dict") response_dict = sequence.get("response_dict")
if 'command' in response_dict: if 'command' in response_dict:
self.assertEquals('show', response_dict['command']) self.assertEquals('show', response_dict['command'])
self.assertEquals('Previous', response_dict['previous']) self.assertEquals('Previous', response_dict['previous'])
self.assertEquals('Configure accounting', response_dict['next']) self.assertEquals('Configure accounting', response_dict['next'])
self.assertCurrentStep('Accounting', response_dict) self.assertCurrentStep('Accounting', response_dict)
...@@ -313,7 +311,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -313,7 +311,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
self.assertEquals(self.preference_group, self.assertEquals(self.preference_group,
preference_buisiness_configurator_item.getProperty( preference_buisiness_configurator_item.getProperty(
'preferred_accounting_transaction_section_category')) 'preferred_accounting_transaction_section_category'))
# 3. some pre-configured accounts # 3. some pre-configured accounts
account_business_configuration_item =\ account_business_configuration_item =\
accounting_business_configuration_save['2'] accounting_business_configuration_save['2']
...@@ -337,7 +335,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -337,7 +335,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
# this ['14'] will break when we'll add more accounts # this ['14'] will break when we'll add more accounts
self.assertEquals('Accounting Period Configurator Item', self.assertEquals('Accounting Period Configurator Item',
accounting_period_configuration_item.getPortalType()) accounting_period_configuration_item.getPortalType())
self.assertEquals(DateTime(2008, 1, 1), self.assertEquals(DateTime(2008, 1, 1),
accounting_period_configuration_item.getStartDate()) accounting_period_configuration_item.getStartDate())
self.assertEquals(DateTime(2008, 12, 31), self.assertEquals(DateTime(2008, 12, 31),
...@@ -396,7 +394,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -396,7 +394,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
# this created a currency # this created a currency
preferences_business_configuration_save = business_configuration.\ preferences_business_configuration_save = business_configuration.\
contentValues(portal_types='Configuration Save')[-1] contentValues(portal_types='Configuration Save')[-1]
currency_business_configuration_item =\ currency_business_configuration_item =\
preferences_business_configuration_save['1'] preferences_business_configuration_save['1']
self.assertEquals('Currency Configurator Item', self.assertEquals('Currency Configurator Item',
...@@ -495,7 +493,6 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -495,7 +493,6 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
expected_list = self.standard_bt5_list + bt5_tuple expected_list = self.standard_bt5_list + bt5_tuple
self.assertEquals([i for i in expected_list if i not in bt5_title_list], []) self.assertEquals([i for i in expected_list if i not in bt5_title_list], [])
self.assertFalse(bc_id in bt5_title_list) self.assertFalse(bc_id in bt5_title_list)
bt = business_configuration.getSpecialiseValue(portal_type="Business Template") bt = business_configuration.getSpecialiseValue(portal_type="Business Template")
...@@ -509,13 +506,13 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -509,13 +506,13 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
expected_link_title_list = list(bt5_tuple) +\ expected_link_title_list = list(bt5_tuple) +\
['erp5_configurator_standard_categories'] ['erp5_configurator_standard_categories']
self.assertSameSet(["%s.bt5" % i for i in expected_link_title_list], self.assertSameSet(["%s.bt5" % i for i in expected_link_title_list],
[i.getTitle() for i in link_list]) [i.getTitle() for i in link_list])
# check for links # check for links
file_list = business_configuration.searchFolder(portal_type="File") file_list = business_configuration.searchFolder(portal_type="File")
self.assertEquals(1, len(file_list)) self.assertEquals(1, len(file_list))
self.assertEquals(business_configuration.getSpecialiseTitle(), self.assertEquals(business_configuration.getSpecialiseTitle(),
file_list[0].getTitle()) file_list[0].getTitle())
file_title_list = ('%s' % bc_id,) file_title_list = ('%s' % bc_id,)
...@@ -549,7 +546,7 @@ class TestConsultingConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -549,7 +546,7 @@ class TestConsultingConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
""" """
DEFAULT_SEQUENCE_LIST = """ DEFAULT_SEQUENCE_LIST = """
stepCreateBusinessConfiguration stepCreateBusinessConfiguration
stepTic stepTic
stepSetConsultingWorkflow stepSetConsultingWorkflow
stepTic stepTic
...@@ -661,7 +658,7 @@ class TestConsultingConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -661,7 +658,7 @@ class TestConsultingConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
] ]
# set preference group # set preference group
self.preference_group = 'group/g' self.preference_group = 'group/g'
def beforeTearDown(self): def beforeTearDown(self):
os.remove(self.categories_file_path) os.remove(self.categories_file_path)
...@@ -674,7 +671,7 @@ class TestConsultingConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -674,7 +671,7 @@ class TestConsultingConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
portal_type="Business Configuration", portal_type="Business Configuration",
title='Test Configurator Consulting Workflow') title='Test Configurator Consulting Workflow')
next_dict = {} next_dict = {}
sequence.edit(business_configuration=business_configuration, sequence.edit(business_configuration=business_configuration,
next_dict=next_dict) next_dict=next_dict)
def stepSetConsultingWorkflow(self, sequence=None, sequence_list=None, **kw): def stepSetConsultingWorkflow(self, sequence=None, sequence_list=None, **kw):
...@@ -774,7 +771,7 @@ class TestConsultingConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -774,7 +771,7 @@ class TestConsultingConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
self.assertEquals(0, len(link_list)) self.assertEquals(0, len(link_list))
def stepCheckMultiplePersonConfigurationItem(self, sequence=None, sequence_list=None, **kw): def stepCheckMultiplePersonConfigurationItem(self, sequence=None, sequence_list=None, **kw):
""" """
Check if multiple Person Configuration Item of the Business Check if multiple Person Configuration Item of the Business
Configuration have been created successfully. Configuration have been created successfully.
""" """
...@@ -840,7 +837,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -840,7 +837,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
Test Live Standard Configuration Workflow. Test Live Standard Configuration Workflow.
""" """
DEFAULT_SEQUENCE_LIST = """ DEFAULT_SEQUENCE_LIST = """
stepCreateBusinessConfiguration stepCreateBusinessConfiguration
stepTic stepTic
stepSetStandardWorkflow stepSetStandardWorkflow
stepTic stepTic
...@@ -974,7 +971,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -974,7 +971,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
), ),
] ]
# set preference group # set preference group
self.preference_group = 'group/my_group' self.preference_group = 'group/my_group'
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 """
...@@ -983,7 +980,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -983,7 +980,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
portal_type="Business Configuration", portal_type="Business Configuration",
title='Test Configurator Standard Workflow') title='Test Configurator Standard Workflow')
next_dict = {} next_dict = {}
sequence.edit(business_configuration=business_configuration, sequence.edit(business_configuration=business_configuration,
next_dict=next_dict) next_dict=next_dict)
def stepSetStandardWorkflow(self, sequence=None, sequence_list=None, **kw): def stepSetStandardWorkflow(self, sequence=None, sequence_list=None, **kw):
...@@ -1062,7 +1059,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -1062,7 +1059,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
default_address_region='americas/south_america/brazil') default_address_region='americas/south_america/brazil')
def stepCheckMultiplePersonConfigurationItem(self, sequence=None, sequence_list=None, **kw): def stepCheckMultiplePersonConfigurationItem(self, sequence=None, sequence_list=None, **kw):
""" """
Check if multiple Person Configuration Item of the Business Check if multiple Person Configuration Item of the Business
Configuration have been created successfully. Configuration have been created successfully.
""" """
...@@ -1149,7 +1146,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -1149,7 +1146,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
'purchase', 'sales'] 'purchase', 'sales']
for account_id in account_id_list: for account_id in account_id_list:
account = self.portal.account_module._getOb(account_id) account = self.portal.account_module._getOb(account_id)
self.assertNotEquals(account, None, self.assertNotEquals(account, None,
"%s account is not Found." % account_id) "%s account is not Found." % account_id)
def stepCheckValidPersonList(self, sequence=None, sequence_list=None, **kw): def stepCheckValidPersonList(self, sequence=None, sequence_list=None, **kw):
...@@ -1203,11 +1200,11 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -1203,11 +1200,11 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
business_configuration = sequence.get("business_configuration") business_configuration = sequence.get("business_configuration")
gadget_list = self.getBusinessConfigurationObjectList(business_configuration, 'Gadget') gadget_list = self.getBusinessConfigurationObjectList(business_configuration, 'Gadget')
for gadget in gadget_list: for gadget in gadget_list:
self.assertEquals('public', gadget.getValidationState(), self.assertEquals('public', gadget.getValidationState(),
"%s is not public but %s" % (gadget.getRelativeUrl(), "%s is not public but %s" % (gadget.getRelativeUrl(),
gadget.getValidationState())) gadget.getValidationState()))
gadget.Base_checkConsistency() gadget.Base_checkConsistency()
def stepCheckPreferenceList(self, sequence=None, sequence_list=None, **kw): def stepCheckPreferenceList(self, sequence=None, sequence_list=None, **kw):
""" """
Assert all the Peference properties. Assert all the Peference properties.
...@@ -1219,7 +1216,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -1219,7 +1216,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
self.assertEquals(len(preference_list), 2) self.assertEquals(len(preference_list), 2)
for preference in preference_list: for preference in preference_list:
self.assertEquals(preference_tool[preference].getPreferenceState(), self.assertEquals(preference_tool[preference].getPreferenceState(),
'global') 'global')
organisation_list = self.getBusinessConfigurationObjectList(business_configuration, organisation_list = self.getBusinessConfigurationObjectList(business_configuration,
...@@ -1242,7 +1239,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -1242,7 +1239,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
preference_tool.getPreferredAccountingTransactionCurrency()) preference_tool.getPreferredAccountingTransactionCurrency())
self.assertEquals('gap/fr/pcg', self.assertEquals('gap/fr/pcg',
preference_tool.getPreferredAccountingTransactionGap()) preference_tool.getPreferredAccountingTransactionGap())
self.assertEquals('group/my_group', self.assertEquals('group/my_group',
preference_tool.getPreferredAccountingTransactionSectionCategory()) preference_tool.getPreferredAccountingTransactionSectionCategory())
self.assertEquals('organisation_module/%s' % organisation_id, self.assertEquals('organisation_module/%s' % organisation_id,
preference_tool.getPreferredAccountingTransactionSourceSection()) preference_tool.getPreferredAccountingTransactionSourceSection())
...@@ -1385,7 +1382,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -1385,7 +1382,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
business_configuration = sequence.get('business_configuration') business_configuration = sequence.get('business_configuration')
organisation_list = self.getBusinessConfigurationObjectList(business_configuration, 'Organisation') organisation_list = self.getBusinessConfigurationObjectList(business_configuration, 'Organisation')
self.assertNotEquals(len(organisation_list), 0) self.assertNotEquals(len(organisation_list), 0)
organisation = organisation_list[0] organisation = organisation_list[0]
period_list = organisation.contentValues(portal_type='Accounting Period') period_list = organisation.contentValues(portal_type='Accounting Period')
self.assertEquals(1, len(period_list)) self.assertEquals(1, len(period_list))
...@@ -1402,7 +1399,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -1402,7 +1399,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
def stepCheckRuleValidation(self, sequence=None, sequence_list=None, **kw): def stepCheckRuleValidation(self, sequence=None, sequence_list=None, **kw):
""" """
Check if rule are validated Check if rule are validated
""" """
business_configuration = sequence.get('business_configuration') business_configuration = sequence.get('business_configuration')
rule_dict = self.portal.ERPSite_getConfiguratorSimulationRuleDict() rule_dict = self.portal.ERPSite_getConfiguratorSimulationRuleDict()
...@@ -2542,17 +2539,17 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -2542,17 +2539,17 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
portal_type='Accounting Transaction', portal_type='Accounting Transaction',
start_date=DateTime(2010, 06, 01), start_date=DateTime(2010, 06, 01),
stop_date=DateTime(2010, 06, 01)) stop_date=DateTime(2010, 06, 01))
accounting_transaction_b = self.portal.accounting_module.newContent( accounting_transaction_b = self.portal.accounting_module.newContent(
portal_type='Accounting Transaction', portal_type='Accounting Transaction',
start_date=DateTime(2010, 06, 01), start_date=DateTime(2010, 06, 01),
stop_date=DateTime(2010, 06, 01)) stop_date=DateTime(2010, 06, 01))
accounting_transaction_c = self.portal.accounting_module.newContent( accounting_transaction_c = self.portal.accounting_module.newContent(
portal_type='Accounting Transaction', portal_type='Accounting Transaction',
start_date=DateTime(2010, 06, 01), start_date=DateTime(2010, 06, 01),
stop_date=DateTime(2010, 06, 01)) stop_date=DateTime(2010, 06, 01))
accounting_transaction_x_related_to_a.setCausalityValue(\ accounting_transaction_x_related_to_a.setCausalityValue(\
accounting_transaction_a) accounting_transaction_a)
...@@ -2563,12 +2560,12 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -2563,12 +2560,12 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
accounting_transaction_a.setCausalityValueList([accounting_transaction_b, accounting_transaction_a.setCausalityValueList([accounting_transaction_b,
accounting_transaction_c]) accounting_transaction_c])
self.stepTic() self.stepTic()
accounting_transaction_list = accounting_transaction_a.\ accounting_transaction_list = accounting_transaction_a.\
AccountingTransaction_getCausalityGroupedAccountingTransactionList() AccountingTransaction_getCausalityGroupedAccountingTransactionList()
self.assertEquals(5, len(accounting_transaction_list)) self.assertEquals(5, len(accounting_transaction_list))
self.assertTrue(accounting_transaction_a in accounting_transaction_list) self.assertTrue(accounting_transaction_a in accounting_transaction_list)
self.assertTrue(accounting_transaction_b in accounting_transaction_list) self.assertTrue(accounting_transaction_b in accounting_transaction_list)
self.assertTrue(accounting_transaction_c in accounting_transaction_list) self.assertTrue(accounting_transaction_c in accounting_transaction_list)
...@@ -2576,16 +2573,16 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -2576,16 +2573,16 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
accounting_transaction_list) accounting_transaction_list)
self.assertTrue(accounting_transaction_y_related_to_a in \ self.assertTrue(accounting_transaction_y_related_to_a in \
accounting_transaction_list) accounting_transaction_list)
accounting_transaction_x_related_to_a.delete() accounting_transaction_x_related_to_a.delete()
accounting_transaction_y_related_to_a.cancel() accounting_transaction_y_related_to_a.cancel()
self.stepTic() self.stepTic()
accounting_transaction_list = accounting_transaction_a.\ accounting_transaction_list = accounting_transaction_a.\
AccountingTransaction_getCausalityGroupedAccountingTransactionList() AccountingTransaction_getCausalityGroupedAccountingTransactionList()
self.assertEquals(3, len(accounting_transaction_list)) self.assertEquals(3, len(accounting_transaction_list))
self.assertFalse(accounting_transaction_x_related_to_a in \ self.assertFalse(accounting_transaction_x_related_to_a in \
accounting_transaction_list) accounting_transaction_list)
self.assertFalse(accounting_transaction_y_related_to_a in \ self.assertFalse(accounting_transaction_y_related_to_a in \
...@@ -2983,7 +2980,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -2983,7 +2980,7 @@ class TestStandardConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
""" """
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
# def exportConfiguratorBusinessTemplate(self): # def exportConfiguratorBusinessTemplate(self):
# """ """ # """ """
# # we save this configuration business template for another test # # we save this configuration business template for another test
......
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