Commit c14813df authored by Łukasz Nowak's avatar Łukasz Nowak

- move node creation to sequence steps and use those nodes that way


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26707 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 11c13a90
...@@ -236,13 +236,26 @@ class TestBPMMixin(ERP5TypeTestCase): ...@@ -236,13 +236,26 @@ class TestBPMMixin(ERP5TypeTestCase):
transaction.commit() transaction.commit()
self.tic() self.tic()
# XXX: move to sequence steps
def stepCreateSource(self, sequence=None, **kw):
module = self.portal.getDefaultModule(portal_type=self.node_portal_type)
node = module.newContent(portal_type=self.node_portal_type)
sequence.edit(source = node)
def stepCreateSourceSection(self, sequence=None, **kw):
module = self.portal.getDefaultModule(portal_type=self.node_portal_type)
node = module.newContent(portal_type=self.node_portal_type)
sequence.edit(source_section = node)
def stepCreateDestination(self, sequence=None, **kw):
module = self.portal.getDefaultModule(portal_type=self.node_portal_type)
node = module.newContent(portal_type=self.node_portal_type)
sequence.edit(destination = node)
def stepCreateDestinationSection(self, sequence=None, **kw):
module = self.portal.getDefaultModule(portal_type=self.node_portal_type) module = self.portal.getDefaultModule(portal_type=self.node_portal_type)
self.source = module.newContent(portal_type=self.node_portal_type) node = module.newContent(portal_type=self.node_portal_type)
self.destination = module.newContent(portal_type=self.node_portal_type) sequence.edit(destination_section = node)
self.source_section = module.newContent(portal_type=self.node_portal_type)
self.destination_section = module.newContent(
portal_type=self.node_portal_type)
def stepCreateOrder(self, sequence=None, **kw): def stepCreateOrder(self, sequence=None, **kw):
module = self.portal.getDefaultModule(portal_type=self.order_portal_type) module = self.portal.getDefaultModule(portal_type=self.order_portal_type)
...@@ -667,12 +680,20 @@ class TestBPMMixin(ERP5TypeTestCase): ...@@ -667,12 +680,20 @@ class TestBPMMixin(ERP5TypeTestCase):
def stepFillOrder(self, sequence=None, **kw): def stepFillOrder(self, sequence=None, **kw):
order = sequence.get('order') order = sequence.get('order')
price_currency = sequence.get('price_currency') price_currency = sequence.get('price_currency')
source = sequence.get('source')
destination = sequence.get('destination')
source_section = sequence.get('source_section')
destination_section = sequence.get('destination_section')
self.assertNotEqual(None, price_currency) self.assertNotEqual(None, price_currency)
self.assertNotEqual(None, source)
self.assertNotEqual(None, destination)
self.assertNotEqual(None, source_section)
self.assertNotEqual(None, destination_section)
order.edit( order.edit(
source_value=self.source, source_value=source,
destination_value=self.destination, destination_value=destination,
source_section_value=self.source_section, source_section_value=source_section,
destination_section_value=self.destination_section, destination_section_value=destination_section,
start_date=self.order_date, start_date=self.order_date,
price_currency_value = price_currency) price_currency_value = price_currency)
...@@ -1018,13 +1039,17 @@ class TestBPMMixin(ERP5TypeTestCase): ...@@ -1018,13 +1039,17 @@ class TestBPMMixin(ERP5TypeTestCase):
) )
class TestBPMTestCases(TestBPMMixin): class TestBPMTestCases(TestBPMMixin):
resource_creation_sequence_string = """ common_documents_creation = """
CreateServiceTax CreateServiceTax
CreateServiceDiscount CreateServiceDiscount
CreatePriceCurrency CreatePriceCurrency
CreateProductDiscounted CreateProductDiscounted
CreateProductTaxed CreateProductTaxed
CreateProductDiscountedTaxed CreateProductDiscountedTaxed
CreateSource
CreateSourceSection
CreateDestination
CreateDestinationSection
Tic Tic
""" """
...@@ -1036,7 +1061,7 @@ class TestBPMTestCases(TestBPMMixin): ...@@ -1036,7 +1061,7 @@ class TestBPMTestCases(TestBPMMixin):
""" """
aggregated_amount_list_common_sequence_string = \ aggregated_amount_list_common_sequence_string = \
resource_creation_sequence_string + """ common_documents_creation + """
CreateBusinessProcess CreateBusinessProcess
CreateBusinessState CreateBusinessState
ModifyBusinessStateTaxed ModifyBusinessStateTaxed
...@@ -1129,7 +1154,7 @@ class TestBPMTestCases(TestBPMMixin): ...@@ -1129,7 +1154,7 @@ class TestBPMTestCases(TestBPMMixin):
def test_TradeModelRuleSimulationWithoutBPM(self): def test_TradeModelRuleSimulationWithoutBPM(self):
"""Tests tree of simulations from Trade Model Rule when there is no BPM""" """Tests tree of simulations from Trade Model Rule when there is no BPM"""
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = self.resource_creation_sequence_string + """ sequence_string = self.common_documents_creation + """
CreateTradeCondition CreateTradeCondition
CreateTradeModelLine CreateTradeModelLine
ModifyTradeModelLineTax ModifyTradeModelLineTax
...@@ -1151,7 +1176,7 @@ class TestBPMTestCases(TestBPMMixin): ...@@ -1151,7 +1176,7 @@ class TestBPMTestCases(TestBPMMixin):
def test_TradeModelRuleSimulationWithoutTradeCondition(self): def test_TradeModelRuleSimulationWithoutTradeCondition(self):
"""Tests tree of simulations from Trade Model Rule when there is no Trade Condition""" """Tests tree of simulations from Trade Model Rule when there is no Trade Condition"""
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = self.resource_creation_sequence_string + """ sequence_string = self.common_documents_creation + """
CreateOrder CreateOrder
FillOrder FillOrder
Tic Tic
......
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