Commit 26ffebd5 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: erp5_trade: Migrate TestOrder{Mixin} and all Unit Tests...

ZODB Components: erp5_trade: Migrate TestOrder{Mixin} and all Unit Tests inheriting from these classes.

Also, Split testInvoice to a Module Component in erp5_invoicing for Mixins used
by several other tests and Test Component in erp5_simplified_invoicing (initially
everything was migrated to erp5_invoicing but this does not work as Alarm_buildInvoice
is different in simplified and advanced invoicing).
parent ded3ba87
...@@ -36,8 +36,8 @@ from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase ...@@ -36,8 +36,8 @@ from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testInvoice import TestSaleInvoiceMixin
from Products.ERP5.tests.utils import newSimulationExpectedFailure from Products.ERP5.tests.utils import newSimulationExpectedFailure
from erp5.component.module.TestInvoiceMixin import TestSaleInvoiceMixin
class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase): class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
"""Test methods for sale and purchase invoice. """Test methods for sale and purchase invoice.
...@@ -149,7 +149,7 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase): ...@@ -149,7 +149,7 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
invoice.start() invoice.start()
self.assertEqual('started', invoice.getSimulationState()) self.assertEqual('started', invoice.getSimulationState())
def stepAddInvoiceTransactionLines(self, sequence=None, sequence_list=[]): def stepAddInvoiceTransactionLines(self, sequence=None, sequence_list=None):
""" """
add some invoice and accounting lines to the invoice add some invoice and accounting lines to the invoice
""" """
...@@ -164,7 +164,7 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase): ...@@ -164,7 +164,7 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
id='income', source='account_module/sale', id='income', source='account_module/sale',
destination='account_module/purchase', quantity=1665) destination='account_module/purchase', quantity=1665)
def stepAddInvoiceLinesManyTransactions(self, sequence=None, sequence_list=[]): def stepAddInvoiceLinesManyTransactions(self, sequence=None, sequence_list=None):
""" """
add some invoice and accounting lines to the invoice add some invoice and accounting lines to the invoice
""" """
...@@ -384,10 +384,10 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase): ...@@ -384,10 +384,10 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
source_section_value=vendor, source_section_value=vendor,
destination_value=client, destination_value=client,
destination_section_value=client) destination_section_value=client)
line = invoice.newContent(portal_type=self.invoice_line_portal_type, invoice.newContent(portal_type=self.invoice_line_portal_type,
resource_value=resource, resource_value=resource,
quantity=10, quantity=10,
price=3) price=3)
invoice.confirm() invoice.confirm()
self.tic() self.tic()
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testAdvancedInvoicing</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testAdvancedInvoicing</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testAdvancedInvoicing</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
test.erp5.testAdvancedInvoicing
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_simulation
erp5_apparel
erp5_project
erp5_simulation_test
erp5_configurator_standard_solver
erp5_configurator_standard_accounting_template
erp5_configurator_standard_invoicing_template
erp5_configurator_standard_trade_template
\ No newline at end of file
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testOrder import TestOrderMixin from erp5.component.test.testOrder import TestOrderMixin
class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase): class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase):
""" """
......
...@@ -32,7 +32,7 @@ import unittest ...@@ -32,7 +32,7 @@ import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testOrder import TestOrderMixin from erp5.component.test.testOrder import TestOrderMixin
from Products.ERP5.tests.utils import newSimulationExpectedFailure from Products.ERP5.tests.utils import newSimulationExpectedFailure
class TestProductionOrderApparelMixin(TestOrderMixin): class TestProductionOrderApparelMixin(TestOrderMixin):
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Module Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>TestInvoiceMixin</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testInvoice</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>module.erp5.TestInvoiceMixin</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Module Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
import unittest import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5.tests.testOrder import TestOrderMixin from erp5.component.test.testOrder import TestOrderMixin
class TestRuleMixin(TestOrderMixin): class TestRuleMixin(TestOrderMixin):
""" """
...@@ -138,7 +138,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) : ...@@ -138,7 +138,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) :
test that when a rule's test method returns False, it will not apply test that when a rule's test method returns False, it will not apply
""" """
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'wrong_script', 'rule', createZODBPythonScript(skin_folder, 'wrong_script', 'rule',
'return False') 'return False')
delivery_rule = self.getRule('default_delivery_rule') delivery_rule = self.getRule('default_delivery_rule')
delivery_rule.setTestMethodId('wrong_script') delivery_rule.setTestMethodId('wrong_script')
...@@ -154,7 +154,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) : ...@@ -154,7 +154,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) :
test that when a rule's test method returns True, it will apply test that when a rule's test method returns True, it will apply
""" """
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'good_script', 'rule', createZODBPythonScript(skin_folder, 'good_script', 'rule',
'return True') 'return True')
delivery_rule = self.getRule('default_delivery_rule') delivery_rule = self.getRule('default_delivery_rule')
delivery_rule.setTestMethodId('good_script') delivery_rule.setTestMethodId('good_script')
...@@ -171,7 +171,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) : ...@@ -171,7 +171,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) :
a good script a good script
""" """
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'good_script', 'rule', createZODBPythonScript(skin_folder, 'good_script', 'rule',
'return True') 'return True')
delivery_rule = self.getRule('default_delivery_rule') delivery_rule = self.getRule('default_delivery_rule')
delivery_rule.setTestMethodId('good_script') delivery_rule.setTestMethodId('good_script')
...@@ -189,7 +189,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) : ...@@ -189,7 +189,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) :
it will not apply it will not apply
""" """
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'good_script', 'rule', createZODBPythonScript(skin_folder, 'good_script', 'rule',
'return True') 'return True')
delivery_rule = self.getRule('default_delivery_rule') delivery_rule = self.getRule('default_delivery_rule')
delivery_rule.setTestMethodId('good_script') delivery_rule.setTestMethodId('good_script')
...@@ -208,7 +208,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) : ...@@ -208,7 +208,7 @@ class TestRule(TestRuleMixin, ERP5TypeTestCase) :
apply apply
""" """
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'good_script', 'rule', createZODBPythonScript(skin_folder, 'good_script', 'rule',
'return True') 'return True')
delivery_rule = self.getRule('default_delivery_rule') delivery_rule = self.getRule('default_delivery_rule')
delivery_rule.setTestMethodId('good_script') delivery_rule.setTestMethodId('good_script')
...@@ -359,7 +359,7 @@ return context.generatePredicate( ...@@ -359,7 +359,7 @@ return context.generatePredicate(
XXX as expand is triggered here, make sure rules won't be created forever XXX as expand is triggered here, make sure rules won't be created forever
""" """
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'rule_script', 'rule', createZODBPythonScript(skin_folder, 'rule_script', 'rule',
"return False") "return False")
# wrong reference # wrong reference
...@@ -408,11 +408,11 @@ return context.generatePredicate( ...@@ -408,11 +408,11 @@ return context.generatePredicate(
XXX as expand is triggered here, make sure rules won't be created forever XXX as expand is triggered here, make sure rules won't be created forever
""" """
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'delivery_rule_script', 'rule', createZODBPythonScript(skin_folder, 'delivery_rule_script', 'rule',
"return False") "return False")
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'invoice_rule_script', 'rule', createZODBPythonScript(skin_folder, 'invoice_rule_script', 'rule',
"return context.getParentValue().getSpecialiseReference() == 'default_delivery_rule'") "return context.getParentValue().getSpecialiseReference() == 'default_delivery_rule'")
delivery_rule = self.getRule('default_delivery_rule') delivery_rule = self.getRule('default_delivery_rule')
...@@ -536,11 +536,11 @@ return context.generatePredicate( ...@@ -536,11 +536,11 @@ return context.generatePredicate(
- test that nothing is changed if at least one child is delivered - test that nothing is changed if at least one child is delivered
""" """
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'delivery_rule_script', 'rule', createZODBPythonScript(skin_folder, 'delivery_rule_script', 'rule',
"return False") "return False")
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'invoice_rule_script', 'rule', createZODBPythonScript(skin_folder, 'invoice_rule_script', 'rule',
"return context.getParentValue().getSpecialiseReference() == 'default_delivery_rule'") "return context.getParentValue().getSpecialiseReference() == 'default_delivery_rule'")
delivery_rule = self.getRule('default_delivery_rule') delivery_rule = self.getRule('default_delivery_rule')
...@@ -622,11 +622,11 @@ return context.generatePredicate( ...@@ -622,11 +622,11 @@ return context.generatePredicate(
- test that nothing is changed if at least one child is delivered - test that nothing is changed if at least one child is delivered
""" """
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'delivery_rule_script', 'rule', createZODBPythonScript(skin_folder, 'delivery_rule_script', 'rule',
"return False") "return False")
skin_folder = self.getPortal().portal_skins.custom skin_folder = self.getPortal().portal_skins.custom
skin = createZODBPythonScript(skin_folder, 'invoice_rule_script', 'rule', createZODBPythonScript(skin_folder, 'invoice_rule_script', 'rule',
"return context.getParentValue().getSpecialiseReference() == 'default_delivery_rule'") "return context.getParentValue().getSpecialiseReference() == 'default_delivery_rule'")
delivery_rule = self.getRule('default_delivery_rule') delivery_rule = self.getRule('default_delivery_rule')
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testRule</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testRule</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testRule</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
module.erp5.TestInvoiceMixin
\ No newline at end of file
test.erp5.testRule
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_apparel
erp5_project
erp5_configurator_standard_solver
erp5_simulation_test_trade_template
erp5_simulation_test
erp5_administration
erp5_dummy_movement
erp5_configurator_standard_accounting_template
erp5_configurator_standard_invoicing_template
\ No newline at end of file
...@@ -32,7 +32,7 @@ from DateTime import DateTime ...@@ -32,7 +32,7 @@ from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import reindex from Products.ERP5Type.tests.utils import reindex
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testInvoice import TestSaleInvoiceMixin from erp5.component.module.TestInvoiceMixin import TestSaleInvoiceMixin
from Products.ERP5.tests.utils import newSimulationExpectedFailure from Products.ERP5.tests.utils import newSimulationExpectedFailure
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
......
...@@ -34,7 +34,7 @@ import unittest ...@@ -34,7 +34,7 @@ import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testOrder import TestOrderMixin from erp5.component.test.testOrder import TestOrderMixin
from Products.ERP5.tests.utils import newSimulationExpectedFailure from Products.ERP5.tests.utils import newSimulationExpectedFailure
class TestProductionOrderMixin(TestOrderMixin): class TestProductionOrderMixin(TestOrderMixin):
......
...@@ -33,7 +33,7 @@ import unittest ...@@ -33,7 +33,7 @@ import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from erp5.component.test.testProductionOrder import TestProductionOrderMixin from erp5.component.test.testProductionOrder import TestProductionOrderMixin
from Products.ERP5.tests.testPackingList import TestPackingListMixin from erp5.component.test.testPackingList import TestPackingListMixin
from Products.ERP5.tests.utils import newSimulationExpectedFailure from Products.ERP5.tests.utils import newSimulationExpectedFailure
class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPackingListMixin, \ class TestProductionPackingReportListMixin(TestProductionOrderMixin, TestPackingListMixin, \
......
...@@ -32,7 +32,7 @@ from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod ...@@ -32,7 +32,7 @@ from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5.tests.testInvoice import TestSaleInvoiceMixin from erp5.component.module.TestInvoiceMixin import TestSaleInvoiceMixin
from Products.ERP5.tests.utils import newSimulationExpectedFailure from Products.ERP5.tests.utils import newSimulationExpectedFailure
class TestNestedLineMixin(TestSaleInvoiceMixin): class TestNestedLineMixin(TestSaleInvoiceMixin):
...@@ -335,7 +335,8 @@ class TestNestedLine(TestNestedLineMixin, ERP5TypeTestCase): ...@@ -335,7 +335,8 @@ class TestNestedLine(TestNestedLineMixin, ERP5TypeTestCase):
return True return True
return False return False
self.tic(stop_condition=stop_condition) self.tic(stop_condition=stop_condition)
update_causality_message_uid, = prioritize_uid_list self.assertEqual(len(prioritize_uid_list), 1)
update_causality_message_uid = prioritize_uid_list[0]
for table in 'message', 'message_queue': for table in 'message', 'message_queue':
self.portal.cmf_activity_sql_connection.manage_test(""" self.portal.cmf_activity_sql_connection.manage_test("""
update %s update %s
...@@ -348,7 +349,7 @@ class TestNestedLine(TestNestedLineMixin, ERP5TypeTestCase): ...@@ -348,7 +349,7 @@ class TestNestedLine(TestNestedLineMixin, ERP5TypeTestCase):
@expectedFailure @expectedFailure
def test_04_MergingMultipleSaleOrders(self, quiet=quiet): def test_04_MergingMultipleSaleOrders(self, quiet=quiet):
sequence_list = SequenceList() sequence_list = SequenceList()
sequence = sequence_list.addSequenceString(self.DEFAULT_SEQUENCE + \ sequence_list.addSequenceString(self.DEFAULT_SEQUENCE + \
""" """
stepCreateOrder stepCreateOrder
stepSetOrderProfile stepSetOrderProfile
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testDeliveryBuilderToSupportMultipleLines</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testDeliveryBuilderToSupportMultipleLines</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testDeliveryBuilderToSupportMultipleLines</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testInvoice</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testInvoice</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
test.erp5.testDeliveryBuilderToSupportMultipleLines
test.erp5.testInvoice
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_simulation
erp5_apparel
erp5_project
erp5_configurator_standard_solver
erp5_simulation_test_trade_template
erp5_simulation_test
erp5_administration
erp5_dummy_movement
erp5_configurator_standard_accounting_template
erp5_configurator_standard_invoicing_template
\ No newline at end of file
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
import unittest import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import Sequence from Products.ERP5Type.tests.Sequence import Sequence
from Products.ERP5.tests.testPackingList import TestPackingListMixin from erp5.component.test.testPackingList import TestPackingListMixin
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
...@@ -65,7 +65,7 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): ...@@ -65,7 +65,7 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
@UnrestrictedMethod @UnrestrictedMethod
def stepResetDeliveringRule(self, sequence): def stepResetDeliveringRule(self, sequence):
original_rule = rule = self.getDeliveringRule() rule = self.getDeliveringRule()
self.assertEqual(rule.getId(), 'new_delivery_simulation_rule') self.assertEqual(rule.getId(), 'new_delivery_simulation_rule')
# We clone the rule and clean it up to be able to experiment with it # We clone the rule and clean it up to be able to experiment with it
portal_rules = self.portal.portal_rules portal_rules = self.portal.portal_rules
...@@ -97,7 +97,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): ...@@ -97,7 +97,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
packing_list = sequence['packing_list'] packing_list = sequence['packing_list']
# XXX-Leo can't we just use sequence['packing_list_line']? # XXX-Leo can't we just use sequence['packing_list_line']?
movement = packing_list.getMovementList()[0] movement = packing_list.getMovementList()[0]
rule = self.getDeliveringRule()
sequence.edit( sequence.edit(
packing_list=packing_list, packing_list=packing_list,
movement=movement, movement=movement,
...@@ -108,7 +107,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): ...@@ -108,7 +107,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
""" """
Modify the quantity of the delivery movement Modify the quantity of the delivery movement
""" """
packing_list = sequence.get('packing_list')
movement = sequence.get('movement') movement = sequence.get('movement')
movement.setQuantity(movement.getQuantity()+1234) movement.setQuantity(movement.getQuantity()+1234)
...@@ -442,7 +440,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): ...@@ -442,7 +440,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
def stepSetNewPrice(self, sequence=None, def stepSetNewPrice(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
packing_list = sequence.get('packing_list')
movement = sequence.get('movement') movement = sequence.get('movement')
movement.setPrice(movement.getPrice()+1234) movement.setPrice(movement.getPrice()+1234)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testDivergenceTester</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testDivergenceTester</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testDivergenceTester</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -32,7 +32,7 @@ This test is experimental for new simulation implementation. ...@@ -32,7 +32,7 @@ This test is experimental for new simulation implementation.
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from testPackingList import TestPackingListMixin from erp5.component.test.testPackingList import TestPackingListMixin
from Products.PythonScripts.Utility import allow_class from Products.PythonScripts.Utility import allow_class
class DummySolverConfiguration(object): class DummySolverConfiguration(object):
...@@ -97,9 +97,9 @@ class TestERP5Simulation(TestPackingListMixin, SecurityTestCase): ...@@ -97,9 +97,9 @@ class TestERP5Simulation(TestPackingListMixin, SecurityTestCase):
solver_process_tool = self.portal.portal_solver_processes solver_process_tool = self.portal.portal_solver_processes
solver_process = solver_process_tool.newSolverProcess(packing_list) solver_process = solver_process_tool.newSolverProcess(packing_list)
sequence.edit(solver_process=solver_process) sequence.edit(solver_process=solver_process)
quantity_solver_decision = filter( quantity_solver_decision = [
lambda x:x.getCausalityValue().getTestedProperty()=='quantity', x for x in solver_process.contentValues()
solver_process.contentValues())[0] if x.getCausalityValue().getTestedProperty()=='quantity'][0]
# use Quantity Split Solver. # use Quantity Split Solver.
quantity_solver_decision.setSolverValue( quantity_solver_decision.setSolverValue(
self.portal.portal_solvers['Quantity Split Solver']) self.portal.portal_solvers['Quantity Split Solver'])
...@@ -113,8 +113,6 @@ class TestERP5Simulation(TestPackingListMixin, SecurityTestCase): ...@@ -113,8 +113,6 @@ class TestERP5Simulation(TestPackingListMixin, SecurityTestCase):
# build split deliveries manually. XXX ad-hoc # build split deliveries manually. XXX ad-hoc
previous_tag = None previous_tag = None
for delivery_builder in packing_list.getBuilderList(): for delivery_builder in packing_list.getBuilderList():
this_builder_tag = '%s_split_%s' % (packing_list.getPath(),
delivery_builder.getId())
after_tag = [] after_tag = []
if previous_tag: if previous_tag:
after_tag.append(previous_tag) after_tag.append(previous_tag)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testERP5Simulation</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testERP5Simulation</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testERP5Simulation</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
import unittest import unittest
from testPurchaseOrder import TestPurchaseOrder from erp5.component.test.testPurchaseOrder import TestPurchaseOrder
class TestInternalOrder(TestPurchaseOrder): class TestInternalOrder(TestPurchaseOrder):
""" """
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testInternalOrder</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testInternalOrder</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testInternalOrder</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testInventory</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testInventory</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testInventory</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -30,7 +30,7 @@ import unittest ...@@ -30,7 +30,7 @@ import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testOrder import TestOrderMixin from erp5.component.test.testOrder import TestOrderMixin
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase): class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
...@@ -275,7 +275,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase): ...@@ -275,7 +275,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
We will put default values for an inventory We will put default values for an inventory
""" """
date = DateTime(self.first_date_string) date = DateTime(self.first_date_string)
inventory = self.createInventory(start_date=date,sequence=sequence) self.createInventory(start_date=date,sequence=sequence)
quantity = self.default_quantity quantity = self.default_quantity
self.createVariatedInventoryLine(start_date=date, self.createVariatedInventoryLine(start_date=date,
sequence=sequence, quantity=quantity) sequence=sequence, quantity=quantity)
...@@ -286,7 +286,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase): ...@@ -286,7 +286,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
We will put default values for an inventory We will put default values for an inventory
""" """
date = DateTime(self.second_date_string) date = DateTime(self.second_date_string)
inventory = self.createInventory(start_date=date,sequence=sequence) self.createInventory(start_date=date,sequence=sequence)
quantity = self.default_quantity - 10 quantity = self.default_quantity - 10
self.createVariatedInventoryLine(start_date=date, self.createVariatedInventoryLine(start_date=date,
sequence=sequence, quantity=quantity) sequence=sequence, quantity=quantity)
...@@ -392,7 +392,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase): ...@@ -392,7 +392,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
- size/Child/34 100 item1,item2 - size/Child/34 100 item1,item2
""" """
date = DateTime(self.first_date_string) date = DateTime(self.first_date_string)
inventory = self.createInventory(start_date=date,sequence=sequence) self.createInventory(start_date=date,sequence=sequence)
quantity = self.default_quantity quantity = self.default_quantity
self.createVariatedInventoryLine(start_date=date, self.createVariatedInventoryLine(start_date=date,
sequence=sequence, quantity=quantity) sequence=sequence, quantity=quantity)
...@@ -464,7 +464,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase): ...@@ -464,7 +464,7 @@ class TestInventoryModule(TestOrderMixin, ERP5TypeTestCase):
- size/Child/34 90 item1 - size/Child/34 90 item1
""" """
date = DateTime(self.second_date_string) date = DateTime(self.second_date_string)
inventory = self.createInventory(start_date=date,sequence=sequence) self.createInventory(start_date=date,sequence=sequence)
quantity = self.default_quantity - 10 quantity = self.default_quantity - 10
item_list = sequence.get('item_list') item_list = sequence.get('item_list')
self.createVariatedInventoryLine(start_date=date, self.createVariatedInventoryLine(start_date=date,
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testInventoryModule</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testInventoryModule</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testInventoryModule</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -30,8 +30,7 @@ import unittest ...@@ -30,8 +30,7 @@ import unittest
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testOrder import TestOrderMixin from erp5.component.test.testOrder import TestOrderMixin
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
class TestInventoryReportModule(TestOrderMixin, SecurityTestCase): class TestInventoryReportModule(TestOrderMixin, SecurityTestCase):
""" """
...@@ -44,7 +43,6 @@ class TestInventoryReportModule(TestOrderMixin, SecurityTestCase): ...@@ -44,7 +43,6 @@ class TestInventoryReportModule(TestOrderMixin, SecurityTestCase):
""" """
""" """
return super(TestInventoryReportModule, self).getBusinessTemplateList() + ('erp5_accounting', 'erp5_mrp',) return super(TestInventoryReportModule, self).getBusinessTemplateList() + ('erp5_accounting', 'erp5_mrp',)
def getTitle(self): def getTitle(self):
return "Inventory Report Module" return "Inventory Report Module"
...@@ -858,5 +856,5 @@ class TestInventoryReportModule(TestOrderMixin, SecurityTestCase): ...@@ -858,5 +856,5 @@ class TestInventoryReportModule(TestOrderMixin, SecurityTestCase):
def _test_suite(): def _test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestInventoryModule)) suite.addTest(unittest.makeSuite(TestInventoryReportModule))
return suite return suite
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testInventoryReportModule</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testInventoryReportModule</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testInventoryReportModule</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -27,14 +27,11 @@ ...@@ -27,14 +27,11 @@
# #
############################################################################## ##############################################################################
import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testOrder import TestOrderMixin from erp5.component.test.testOrder import TestOrderMixin
from Products.ERP5.tests.testInventoryAPI import InventoryAPITestCase from Products.ERP5.tests.testInventoryAPI import InventoryAPITestCase
from Products.ERP5Type.tests.utils import createZODBPythonScript
class TestOrderBuilderMixin(TestOrderMixin, InventoryAPITestCase): class TestOrderBuilderMixin(TestOrderMixin, InventoryAPITestCase):
...@@ -425,9 +422,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase): ...@@ -425,9 +422,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
sequence_list.play(self) sequence_list.play(self)
def createSelectMethodForBuilder(self):
portal = self.getPortal()
def checkOrderBuilderStockOptimisationResult(self, expected_result, **kw): def checkOrderBuilderStockOptimisationResult(self, expected_result, **kw):
result_list = [(x.getResource(), x.getVariationText(), x.getQuantity(), result_list = [(x.getResource(), x.getVariationText(), x.getQuantity(),
x.getStartDate().strftime("%Y/%m/%d"), x.getStartDate().strftime("%Y/%m/%d"),
...@@ -449,7 +443,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase): ...@@ -449,7 +443,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
self.pinDateTime(fixed_date) self.pinDateTime(fixed_date)
self.createOrderBuilder() self.createOrderBuilder()
self.fillOrderBuilder() self.fillOrderBuilder()
node_1_uid = node_1.getUid()
self.checkOrderBuilderStockOptimisationResult([], node_uid=node_1.getUid()) self.checkOrderBuilderStockOptimisationResult([], node_uid=node_1.getUid())
self._makeMovement(quantity=-3, destination_value=node_1, simulation_state='confirmed') self._makeMovement(quantity=-3, destination_value=node_1, simulation_state='confirmed')
resource_url = self.resource.getRelativeUrl() resource_url = self.resource.getRelativeUrl()
...@@ -465,7 +458,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase): ...@@ -465,7 +458,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
""" """
node_1 = self.node_1 node_1 = self.node_1
node_2 = self.node_2 node_2 = self.node_2
resource = self.resource
self.createOrderBuilder() self.createOrderBuilder()
self.fillOrderBuilder() self.fillOrderBuilder()
fixed_date = DateTime('2016/08/10') fixed_date = DateTime('2016/08/10')
...@@ -506,7 +498,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase): ...@@ -506,7 +498,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
fixed_date = DateTime('2018/01/03') fixed_date = DateTime('2018/01/03')
self.pinDateTime(fixed_date) self.pinDateTime(fixed_date)
resource_url = self.resource.getRelativeUrl() resource_url = self.resource.getRelativeUrl()
node_uid_list = [node_1.getUid(), self.node_2.getUid()]
self.checkOrderBuilderStockOptimisationResult([], node_uid=node_1.getUid()) self.checkOrderBuilderStockOptimisationResult([], node_uid=node_1.getUid())
movement = self._makeMovement(quantity=3, destination_value=node_1, simulation_state='delivered', movement = self._makeMovement(quantity=3, destination_value=node_1, simulation_state='delivered',
start_date=DateTime('2018/01/10'), variation_category_list=variation_category_list) start_date=DateTime('2018/01/10'), variation_category_list=variation_category_list)
...@@ -549,7 +540,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase): ...@@ -549,7 +540,6 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
self.portal.portal_caches.clearAllCache() self.portal.portal_caches.clearAllCache()
self.assertTrue('auto_planned' in self.portal.getPortalFutureInventoryStateList()) self.assertTrue('auto_planned' in self.portal.getPortalFutureInventoryStateList())
# end of patch # end of patch
resource = self.resource
self.createOrderBuilder() self.createOrderBuilder()
self.fillOrderBuilder() self.fillOrderBuilder()
fixed_date = DateTime('2018/09/21') fixed_date = DateTime('2018/09/21')
...@@ -563,10 +553,10 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase): ...@@ -563,10 +553,10 @@ class TestOrderBuilder(TestOrderBuilderMixin, ERP5TypeTestCase):
self._makeMovement(quantity=-5, destination_value=self.node_1, simulation_state='confirmed', self._makeMovement(quantity=-5, destination_value=self.node_1, simulation_state='confirmed',
start_date=DateTime('2018/09/21')) start_date=DateTime('2018/09/21'))
checkStockOptimisationForTwoNodes([(resource_url, '', 5.0, '2018/09/21', '2018/09/21')]) checkStockOptimisationForTwoNodes([(resource_url, '', 5.0, '2018/09/21', '2018/09/21')])
auto_planned_one = self._makeMovement(quantity=3, destination_value=self.node_2, simulation_state='auto_planned', self._makeMovement(quantity=3, destination_value=self.node_2, simulation_state='auto_planned',
start_date=DateTime('2018/09/18')) start_date=DateTime('2018/09/18'))
checkStockOptimisationForTwoNodes([(resource_url, '', 2.0, '2018/09/21', '2018/09/21')]) checkStockOptimisationForTwoNodes([(resource_url, '', 2.0, '2018/09/21', '2018/09/21')])
auto_planned_two = self._makeMovement(quantity=2, destination_value=self.node_1, simulation_state='auto_planned', self._makeMovement(quantity=2, destination_value=self.node_1, simulation_state='auto_planned',
start_date=DateTime('2018/09/19')) start_date=DateTime('2018/09/19'))
checkStockOptimisationForTwoNodes([]) checkStockOptimisationForTwoNodes([])
# But if we more stock than expected, auto planned movements should be reduced # But if we more stock than expected, auto planned movements should be reduced
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
############################################################################## ##############################################################################
import unittest import unittest
from testPackingList import TestPackingList from erp5.component.test.testPackingList import TestPackingList
class TestPackingListRoundingPrecision(TestPackingList): class TestPackingListRoundingPrecision(TestPackingList):
""" """
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
import unittest import unittest
from testOrder import TestOrder from erp5.component.test.testOrder import TestOrder
class TestPurchaseOrder(TestOrder): class TestPurchaseOrder(TestOrder):
""" """
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
import unittest import unittest
from testOrder import TestOrder from erp5.component.test.testOrder import TestOrder
class TestReturnedSaleOrder(TestOrder): class TestReturnedSaleOrder(TestOrder):
""" """
......
This diff is collapsed.
This diff is collapsed.
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