Commit 056285ae authored by Rafael Monnerat's avatar Rafael Monnerat

Rename test and do rough draft implementation

parent 045967a6
...@@ -29,42 +29,61 @@ from Products.ERP5Configurator.tests.ConfiguratorTestMixin import \ ...@@ -29,42 +29,61 @@ from Products.ERP5Configurator.tests.ConfiguratorTestMixin import \
TestLiveConfiguratorWorkflowMixin TestLiveConfiguratorWorkflowMixin
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): class TestVifibConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
""" """
Configurator Mixin Class Configurator Mixin Class
""" """
# The list of standard business templates that the configurator should force # The list of standard business templates that the configurator should force
# to install # to install
user_reference = "demo" user_reference = "demo"
standard_bt5_list = ('erp5_simulation', standard_bt5_list = (
'erp5_dhtml_style', 'erp5_simulation',
'erp5_jquery', 'erp5_administration',
'erp5_jquery_ui', 'erp5_pdm',
'erp5_xhtml_jquery_style', 'erp5_trade',
'erp5_ingestion_mysql_innodb_catalog', 'erp5_simulation_test',
'erp5_ingestion', 'erp5_item',
'erp5_web', 'erp5_open_trade',
'erp5_dms', 'erp5_forge',
'erp5_crm', 'erp5_ingestion_mysql_innodb_catalog',
'erp5_pdm', 'erp5_ingestion',
'erp5_trade', 'erp5_crm',
'erp5_knowledge_pad', 'erp5_jquery',
'erp5_accounting', 'erp5_jquery_ui',
'erp5_tax_resource', 'erp5_knowledge_pad',
'erp5_discount_resource', 'erp5_web',
'erp5_invoicing', 'erp5_dms',
'erp5_configurator_standard_categories', 'erp5_l10n_fr',
'erp5_trade_knowledge_pad', 'erp5_content_translation',
'erp5_crm_knowledge_pad', 'erp5_software_pdm',
'erp5_simulation_test', 'erp5_computer_immobilisation',
'erp5_simplified_invoicing', 'erp5_accounting',
'erp5_ods_style', 'erp5_accounting_l10n_fr',
'erp5_odt_style', 'erp5_tax_resource',
'erp5_ooo_import', 'erp5_discount_resource',
'erp5_accounting_l10n_fr', 'erp5_invoicing',
'erp5_l10n_fr', 'erp5_ods_style',
'erp5_l10n_pt-BR', 'erp5_odt_style',
'erp5_demo_maxma_rule') 'erp5_ooo_import',
'erp5_simplified_invoicing',
'erp5_legacy_tax_system',
'erp5_commerce',
'erp5_project',
'erp5_credential',
'erp5_km',
'erp5_web_download_theme',
'vifib_mysql_innodb_catalog',
'vifib_core',
'vifib_base',
'vifib_slap',
'vifib_crm',
'vifib_forge_release',
'vifib_software_pdm',
'vifib_web',
'vifib_open_trade',
'vifib_l10n_fr',
'vifib_datas',
'vifib_erp5')
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
return ('erp5_core_proxy_field_legacy', return ('erp5_core_proxy_field_legacy',
...@@ -72,7 +91,7 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -72,7 +91,7 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
'erp5_base', 'erp5_base',
'erp5_workflow', 'erp5_workflow',
'erp5_configurator', 'erp5_configurator',
'erp5_configurator_maxma_demo',) 'erp5_configurator_vifib',)
def stepCreateBusinessConfiguration(self, sequence=None,\ def stepCreateBusinessConfiguration(self, sequence=None,\
sequence_list=None, **kw): sequence_list=None, **kw):
...@@ -80,7 +99,7 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -80,7 +99,7 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
module = self.portal.business_configuration_module module = self.portal.business_configuration_module
business_configuration = module.newContent( business_configuration = module.newContent(
portal_type="Business Configuration", portal_type="Business Configuration",
title='Test Configurator Maxma Demo Workflow') title='Test Configurator Vifib 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)
...@@ -94,44 +113,13 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -94,44 +113,13 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
self.assertEquals('show', response_dict['command']) self.assertEquals('show', response_dict['command'])
self.assertEquals('Install', response_dict['next']) self.assertEquals('Install', response_dict['next'])
def stepSetMaxmaDemoWorkflow(self, sequence=None, sequence_list=None, **kw): def stepSetVifibWorkflow(self, sequence=None, sequence_list=None, **kw):
""" Set Consulting Workflow into Business Configuration """ """ Set Consulting Workflow into Business Configuration """
business_configuration = sequence.get("business_configuration") business_configuration = sequence.get("business_configuration")
self.setBusinessConfigurationWorkflow(business_configuration, self.setBusinessConfigurationWorkflow(business_configuration,
"workflow_module/maxma_demo_configuration_workflow") "workflow_module/vifib_configuration_workflow")
def stepViewCreatedPersons(self, sequence=None, sequence_list=None, **kw):
self.login(user_name='test_configurator_user')
person_list = self.portal.person_module.searchFolder()
self.assertNotEquals(0, len(person_list))
for entity in person_list:
for username in self.all_username_list:
self.failUnlessUserCanAccessDocument(username, entity)
self.failUnlessUserCanViewDocument(username, entity)
def stepViewCreatedOrganisations(self, sequence=None, sequence_list=None, **kw):
self.login(user_name='test_configurator_user')
organisation_list = self.portal.organisation_module.searchFolder()
self.assertNotEquals(0, len(organisation_list))
for entity in organisation_list:
for username in self.all_username_list:
self.failUnlessUserCanAccessDocument(username, entity)
self.failUnlessUserCanViewDocument(username, entity)
def stepViewCreatedAssignemnts(self, sequence=None, sequence_list=None, **kw):
self.login(user_name='test_configurator_user')
person_list = self.portal_person_module.searchFolder()
self.assertNotEquals(0, len(person_list))
for person in person_list:
for assignment in person.contentValues(portal_type='Assignment'):
for username in self.all_username_list:
self.failUnlessUserCanAccessDocument(username, assignment)
self.failUnlessUserCanViewDocument(username, assignment)
def stepCheckMaxmaDemoSampleObjectList(self, sequence=None, sequence_list=None, **kw): def stepCheckMaxmaDemoSampleObjectList(self, sequence=None, sequence_list=None, **kw):
""" Check if objects are placed into the appropriate state """ """ Check if objects are placed into the appropriate state """
...@@ -143,22 +131,11 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -143,22 +131,11 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
gadget.getValidationState())) gadget.getValidationState()))
gadget.Base_checkConsistency() gadget.Base_checkConsistency()
# Check if demo user is working.
user = self.portal.portal_catalog.getResultValue(portal_type="Person",
reference=self.user_reference)
self.assertNotEquals(user.Person_getAvailableAssignmentValueList(), [])
self.assertEquals(user.getTitle(), "Jack Vale")
self.assertEquals(user.getValidationState(), "validated")
self.assertEquals(user.getSubordination(),
'organisation_module/myorganisation')
self.assertEquals(user.getSubordinationTitle(), "Maxma Co")
### STEPS ### STEPS
DEFAULT_SEQUENCE_LIST = """ DEFAULT_SEQUENCE_LIST = """
stepCreateBusinessConfiguration stepCreateBusinessConfiguration
stepTic stepTic
stepSetMaxmaDemoWorkflow stepSetVifibWorkflow
stepTic stepTic
stepConfiguratorNext stepConfiguratorNext
stepTic stepTic
...@@ -171,61 +148,9 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -171,61 +148,9 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
stepStartConfigurationInstallation stepStartConfigurationInstallation
stepTic stepTic
stepCheckInstanceIsConfigured%(country)s stepCheckInstanceIsConfigured%(country)s
stepCheckMaxmaDemoSampleObjectList
stepTic
stepViewAddGadget
stepViewEventModule
stepAddEvent
stepSentEventWorkflow
stepViewAccountModule
stepAddAccountModule
stepViewAccount
stepCopyPasteAccount
stepViewEntityModules
stepAddEntityModules
stepCopyAndPastePerson
stepCopyAndPasteOrganisation
stepEntityWorkflow
stepViewCreatedPersons
stepViewCreatedOrganisations
stepViewCreatedAssignemnts
stepAddAccoutingPeriod
stepValidatedAccountingPeriods
stepViewBankAccount
stepViewCreditCard
stepValidateAndModifyBankAccount
stepValidateAndModifyCreditCard
stepAddPaymentNodeInPerson
stepAddPaymentNodeInOrganisation
stepCopyAndPasteBankAccountInPerson
stepCopyAndPasteBankAccountInOrganisation
stepViewAccountingTransactionModule
stepAddAccountingTransactionModule
stepCopyAndPasteAccountingTransactions
stepTic
stepAccountingTransaction
stepTic
stepSaleInvoiceTransaction
stepTic
stepPurchaseInvoiceTransaction
stepTic
stepPaymentTransaction
stepTic
stepBalanceTransaction
stepTic
stepAccountingTransaction_getCausalityGroupedAccountingTransactionList
stepAddAssignments
stepAssignmentTI
stepEditAssignments
stepViewAcessAddPurchaseTradeCondition
stepViewAccessAddSaleTradeCondition
stepViewAccessAddSaleOrder
stepViewAccessAddSalePackingList
stepViewAccessPurchaseOrder
stepPurchasePackingList
""" """
def test_maxma_demo_workflow(self): def test_vifib_workflow(self):
""" Test the consulting workflow configuration""" """ Test the consulting workflow configuration"""
self.all_username_list = ["demo"] self.all_username_list = ["demo"]
self.accountant_username_list = self.all_username_list self.accountant_username_list = self.all_username_list
...@@ -241,5 +166,5 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -241,5 +166,5 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
import unittest import unittest
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestMaxmaDemoConfiguratorWorkflow)) suite.addTest(unittest.makeSuite(TestVifibConfiguratorWorkflow))
return suite return suite
8 9
\ No newline at end of file \ No newline at end of file
testMaxmaDemoConfigurationWorkflow testVifibConfigurationWorkflow
\ 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